\chapter{Data combination}\label{sec:USDataCombi}

DAM can generate input for the kernels by combining the data from the source files. This is done by linking via the location id and via GIS-files (see \autoref{sec:DataExtraction}).

\section{Id/Name}\label{sec:IdNameValidation}
The data is combined by matching Id's (Names) between the several data sources. Not all characters can be used when defining Id's. The following characters are valid: \newline
"ABCDEFGHIJKLMNOPQRSTUVWXYZ" \newline
"abcdefghijklmnopqrstuvwxyz" \newline
"01234567879" \newline
"!\#\textdollar \% \&()*+,-.\/" \newline
":;<=>?@" \newline
"[\textbackslash ]\textasciicircum \_\textasciigrave " \newline
"\{|\}\textasciitilde " \newline
" " (space)\newline
A validation of the Id's must be done when performing the data combination.

\section{Data extraction}\label{sec:DataExtraction}

The locations are described with a name and RD-coordinates; a point element in GIS files.
Each location is connected to a crosssection; a line element in GIS files.

The combination of data from GIS files is made based on these point and line elements.\\
If the input data is available in a GIS file with line elements the data is collected at the intersection of the crosssection with the line element, see \autoref{fig:GISLine}.

When a parameter is available in a line shape, \ProgramName will check, during import of data, if the cross section of a location intersects the shapefile of the parameter. When so, this parameter is connected to this location.
If a cross section intersects more than one line of the shapefile, no parameters are connected at all and a message is given that this location is not imported.

\begin{figure}[H]
	\centering
		\includegraphics[width=0.7\textwidth]{pictures/GISLine.png}
	\caption{Data is collected from the line element at the intersection}
	\label{fig:GISLine}
\end{figure}

If the input data is available in a GIS file with area elements the data is collected at from the area where the location point is situated, see \autoref{fig:GISArea}.

\begin{figure}[H]
	\centering
		\includegraphics[width=0.7\textwidth]{pictures/GISArea.png}
	\caption{Data is collected from the area element where the location point is situated}
	\label{fig:GISArea}
\end{figure}

If the inputdata is not available in GIS files, all input data can be linked to each location via a table (csv-format).

\section{Geometry Generation}\label{sec:GeometryGeneration}

The \ProgramName can combine a surface line with a subsoil scenario. The result is a geometry, usable for the failure mechanism Macrostability. 

\section{Subsoil}
The subsoil model is made up of the following elements:
\begin{itemize}
	\item Soil segments
	\item Soil profiles
	\item Soil layers
	\item Soil materialparameters
\end{itemize}

A soil segment is located on a map and can contain several soil scenarios. A soil scenario is a combination of a soil profile and its probability.
Each soil profile is build up from layers (1D- profile) or areas (2D-profile). A layer (or area) has the name of a material. And finally this material is described via soil type and several parameters (such as strength parameters).\\
All is displayed in \autoref{fig:SubSoilElements}.

\begin{figure}[H]
	\centering
		\includegraphics[width=1\textwidth]{pictures/SubSoilElements.png}
	\caption{The elements of the subsoil model and their properties}
	\label{fig:SubSoilElements}
\end{figure}

By linking the location to a soil segment via the locations.csv column segment\textunderscore id, \ProgramName combines the location to all soil profiles of the soil segment.
The use of D-Soil Model for this purpose is decribed in \autoref{sec:DSoilmodel}.
The procedure for combining a surfaceline with a soil profile is described in \autoref{sec:CombiSurfaceLineSoilProfile}.

\section{Combination of surface line with soil profile}\label{sec:CombiSurfaceLineSoilProfile}

\subsection{Combination of surface line with a 1D soilprofile}\label{sec:CombiSurfaceLine1DSoilProfile}
A 1D soil profile is a summation of layers with layer boundaries (Z-values) and materialnames. Combination with a surfaceline is uncomplicated if all the Z-values of the surface line are within the boundaries of the soil profile.
If not, the user can define a filling material.

\subsection{Transfer of 1D soilprofile}\label{sec:Transfer1D}
The user can vertically transfer the 1D profiles by defining a characteristic point as a reference level. This means that the Z-value of the characteristic point is the top of all 1D-soilprofiles of that location. This reference level is given per project. So if the surfacelevelinside is the reference, for each location the 1D-soilprofiles will start at the Z-value of the surfacelevelinside of that location. On top of the 1D soilprofile the filling material is used.

\subsection{Combination of surface line with a 2D soilprofile}\label{sec:CombiSurfaceLine2DSoilProfile}
A 2D profile already has a topboundary with different Z-values. Combination with a surface line is more complicated since this top boundary and surfacel may differ in X and/or Z-values.
The origin of the surfaceline can differ from the origin of the top boundary of the soil profile. The user can define this difference. The surfaceline is determing the final length of the combinated 2D-profile.
If the surface line xxx soil profile length: subsoil at the right side will be deleted
If the surface line xxx soil profile length: subsoil at the right side will be generated with Z-values at boundary.

