Changeset 27 for trunk/tutorial
- Timestamp:
- 02/28/13 14:38:27 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tutorial/model_tutorial.tex
r21 r27 36 36 37 37 \begin{figure} [htbp] 38 39 40 41 38 \centering 39 \includegraphics[width=1\textwidth]{img/workflow.pdf} 40 \caption{Conceptual workflow} 41 \label{fig:conceptual-workflow} 42 42 \end{figure} 43 43 … … 45 45 46 46 \section{Data needed} 47 In order work, TmDmCreator needs the following files:47 For proper operation, TmDmCreator requires the following files: 48 48 %\begin{itemize} 49 49 \begin{description*} 50 50 \item[base\_structure.sql]\hfill \\ contains the necessary SQL code base for all ToolMap projects. This file should normally not be edited by users 51 51 \item[user\_structure.sql]\hfill \\ contains the SQL structure describing the layers attributes … … 74 74 75 75 \begin{figure} [hbp] 76 77 78 79 76 \centering 77 \includegraphics[width=.6\textwidth]{img/layers.png} 78 \caption{List of layers as shown in user\_content.txt} 79 \label{fig:layers} 80 80 \end{figure} 81 81 … … 97 97 98 98 \begin{figure} [hbp] 99 100 101 102 99 \centering 100 \includegraphics[height=.9\textheight]{img/objects.png} 101 \caption{Objects structure as described in user\_content.txt} 102 \label{fig:objects} 103 103 \end{figure} 104 104 … … 111 111 -- layer_at1 -- 112 112 CREATE TABLE `layer_at1` ( 113 114 115 116 113 `OBJECT_ID` int(10) unsigned NOT NULL, 114 -- add user attributes here -- 115 PRIMARY KEY (`OBJECT_ID`), 116 KEY `LAYER_ATX_FKIndex1` (`OBJECT_ID`) 117 117 ) ENGINE=MyISAM DEFAULT CHARSET=utf8; 118 118 \end{lstlisting} 119 119 This code is the basic template for creating an attribute table. The number after layer\_at (see line 2) indicates the layer index and refers to the LAYER\_INDEX column in user\_content.txt. In our example layer\_at1 describe the attributes for the layer Boreholes\_PT. User attributes can then be added on line 4 of this template. 120 120 Below are described the five attributes that can be used in a ToolMap data model as well as the corresponding SQL code 121 122 121 123 \subsubsection {Enumeration} 122 124 \label{sec:enumeration} 123 \crealplisting{SQL} 124 \begin{lstlisting} 125 `D_C_UNDERG` int(11) DEFAULT NULL COMMENT 'ENUMERATION', 126 \end{lstlisting} 127 If you add such fields, then you must also fill the list of supported values (see section~\ref{sec:attribute-values}). 128 \subsubsection {Text} 129 \begin{lstlisting} 130 `DESCRIPT` varchar(255) DEFAULT NULL, 131 \end{lstlisting} 132 The number next to the keyword varchar indicates the maximum text length. 133 \subsubsection {Integer} 134 \begin{lstlisting} 135 `NUM_REF` int(11) DEFAULT NULL, 136 \end{lstlisting} 137 There is no special option for integer fields 138 \subsubsection {Float} 125 \crealplisting{SQL} 126 \begin{lstlisting} 127 `D_C_UNDERG` int(11) DEFAULT NULL COMMENT 'ENUMERATION', 128 \end{lstlisting} 129 If you add such fields, then you must also fill the list of supported values (see section~\ref{sec:attribute-values}). 130 \subsubsection {Text} 131 \begin{lstlisting} 132 `DESCRIPT` varchar(255) DEFAULT NULL, 133 \end{lstlisting} 134 The number next to the keyword varchar indicates the maximum text length. 135 \subsubsection {Integer} 136 \begin{lstlisting} 137 `NUM_REF` int(11) DEFAULT NULL, 138 \end{lstlisting} 139 There is no special option for integer fields 139 140 140 \begin{lstlisting}141 `TEMP` decimal(5,2) DEFAULT NULL,142 \end{lstlisting}143 The two digits next to the keyword decimal indicate the field precision and scale. In this example, 5 is the precision and 2 is the scale. The precision represents the number of significant digits that are stored for values, and the scale represents the number of digits that can be stored following the decimal point. In this case, values that can be stored range from -999.99 to 999.99.144 \subsubsection {Date}145 141 146 \begin{lstlisting} 147 `REF_DATE` date DEFAULT NULL, 148 \end{lstlisting} 149 There is no special option for date fields 142 \subsubsection {Float} 143 144 \begin{lstlisting} 145 `TEMP` decimal(5,2) DEFAULT NULL, 146 \end{lstlisting} 147 The two digits next to the keyword decimal indicate the field precision and scale. In this example, 5 is the precision and 2 is the scale. The precision represents the number of significant digits that are stored for values, and the scale represents the number of digits that can be stored following the decimal point. In this case, values that can be stored range from -999.99 to 999.99. 148 \subsubsection {Date} 149 150 \begin{lstlisting} 151 `REF_DATE` date DEFAULT NULL, 152 \end{lstlisting} 153 There is no special option for date fields 150 154 151 155 … … 165 169 166 170 \begin{figure} [htbp] 167 168 169 170 171 \centering 172 \includegraphics[width=.9\textwidth]{img/attributs.png} 173 \caption{Attributes section structure} 174 \label{fig:attributs} 171 175 \end{figure} 172 176
Note: See TracChangeset
for help on using the changeset viewer.