- Timestamp:
- 02/20/13 15:41:55 (12 years ago)
- Location:
- trunk/tutorial
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tutorial/crealp-report.sty
r9 r12 26 26 27 27 \usepackage{listings} 28 \usepackage{color} 29 30 \definecolor{dkgreen}{rgb}{0,0.6,0} 31 \definecolor{gray}{rgb}{0.5,0.5,0.5} 32 \definecolor{mauve}{rgb}{0.58,0,0.82} 28 33 29 34 %% nouvelle commande pour les listings %% 30 35 \newcommand{\crealplisting} [1]{ 31 \lstset{ 32 language=#1, 33 breaklines=true 34 basicstyle=\ttfamily 35 showstringspaces=false, 36 columns=fullflexible, 37 frame=leftline, 38 captionpos=b 39 } 36 \lstset{ % 37 backgroundcolor=\color{white}, % choose the background color; you must add \usepackage{color} or \usepackage{xcolor} 38 basicstyle=\footnotesize, % the size of the fonts that are used for the code 39 breakatwhitespace=false, % sets if automatic breaks should only happen at whitespace 40 breaklines=true, % sets automatic line breaking 41 captionpos=b, % sets the caption-position to bottom 42 commentstyle=\color{dkgreen}, % comment style 43 deletekeywords={...}, % if you want to delete keywords from the given language 44 %escapeinside={\%*}{*)}, % if you want to add LaTeX within your code 45 %extendedchar=true, % lets you use non-ASCII characters; for 8-bits encodings only, does not work with UTF-8 46 frame=single, % adds a frame around the code 47 keywordstyle=\color{blue}, % keyword style 48 language=#1, % the language of the code 49 morekeywords={*,...}, % if you want to add more keywords to the set 50 numbers=left, % where to put the line-numbers; possible values are (none, left, right) 51 numbersep=5pt, % how far the line-numbers are from the code 52 numberstyle=\tiny\color{gray}, % the style that is used for the line-numbers 53 rulecolor=\color{black}, % if not set, the frame-color may be changed on line-breaks within not-black text (e.g. comments (green here)) 54 showspaces=false, % show spaces everywhere adding particular underscores; it overrides 'showstringspaces' 55 showstringspaces=false, % underline spaces within strings only 56 showtabs=false, % show tabs within strings adding particular underscores 57 stepnumber=1, % the step between two line-numbers. If it's 1, each line will be numbered 58 stringstyle=\color{mauve}, % string literal style 59 tabsize=2, % sets default tabsize to 2 spaces 60 %title=\lstname % show the filename of files included with \lstinputlisting; also try caption instead of title 61 } 40 62 } 41 63 -
trunk/tutorial/model_tutorial.tex
r11 r12 19 19 20 20 \section{Introduction} 21 This tutorial explains how to create a project ToolMapmanually. This approach has the following advantages:21 This tutorial explains how to create a ToolMap project manually. This approach has the following advantages: 22 22 \begin{enumerate*} 23 23 \item It ensures the IDs used … … 25 25 \item It allows better monitoring of model changes 26 26 \end{enumerate*} 27 The main disadvantage of this approach is the lack of user interface as well as the need for the user to have some knowledge of SQL. Finally, this approach has been developed to meet the need for rigor in the management of the geological data model.27 The main disadvantage of this approach is the lack of user interface as well as the need for the user to have some knowledge of SQL. Finally, this approach has been developed to meet the need for rigor in the management of the Swiss geological data model. 28 28 29 29 … … 59 59 60 60 \subsection{Layers} 61 Open user\_content.txt using a spreadsheet and edit the thematic\_layers part. Each of the layers that we want to export should appear here. The structure is as follows (see figure ???):61 Open user\_content.txt using a spreadsheet and edit the thematic\_layers part. Each of the layers that we want to export should appear here. The structure is as follows (see figure~\ref{fig:layers}): 62 62 \begin{description*} 63 63 \item [LAYER\_INDEX] unique identifier of the layer 64 64 \item [TYPE\_CD] layer spatial type as follow 65 65 \begin{description*} 66 \item [0] Line67 \item [1] Point68 \item [2] Polygon66 \item [0] = Line 67 \item [1] = Point 68 \item [2] = Polygon 69 69 \end{description*} 70 70 \item [LAYER\_NAME] the layer name. This name will be given to the SHP file when exporting 71 71 \end{description*} 72 72 73 \begin{figure} [hbp] 74 \centering 75 \includegraphics[width=.6\textwidth]{img/layers.png} 76 \caption{List of layers as shown in user\_content.txt} 77 \label{fig:layers} 78 \end{figure} 79 73 80 \subsection{Objects} 74 81 82 Edit the file user\_content.txt to add objects. They must have the following structure (See figure:~\ref{fig:objects}): 83 \begin{description*} 84 \item [OBJECT\_ID] object unique ID. 85 \item [OBJECT\_CD] object code, should not necessarily be unique 86 \item [OBJECT\_TYPE\_CD] object spatial type, uses same values as those described above for TYPE\_CD in thematic\_layers 87 \item [THEMATIC\_LAYERS\_LAYER\_INDEX] the index of the layer that the object refers to. The value 1 shown in the example (Figure 2) therefore relates to the theme Boreholes\_PT. 88 \item [OBJECT\_DESC\_0,1,2,3,4,5] object description in up to 5 languages. 89 \item [OBJECT\_ISFREQ] Set to 1 for frequent objects and 0 otherwise. This parameter is only taken into account for line type objects. Set to 0 for all point or polygon objects. 90 \item [SYMBOL\_CD] leave empty 91 \item [RANK] leave empty 92 \item [REMARK] leave empty 93 \end{description*} 94 95 \begin{figure} [hbp] 96 \centering 97 \includegraphics[height=.9\textheight]{img/objects.png} 98 \caption{Objects structure as described in user\_content.txt} 99 \label{fig:objects} 100 \end{figure} 101 102 75 103 \subsection{Attributes structure} 104 Edit the file user\_structure.sql with Notepad (or even better with Notepad + +). For each topic containing attributes, there must be a SQL code of the type: 105 106 \crealplisting{SQL} 107 \begin{lstlisting} 108 -- layer_at1 -- 109 CREATE TABLE `layer_at1` ( 110 `OBJECT_ID` int(10) unsigned NOT NULL, 111 PRIMARY KEY (`OBJECT_ID`), 112 KEY `LAYER_ATX_FKIndex1` (`OBJECT_ID`) 113 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 114 \end{lstlisting} 115 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. 116 Below are described the five attributes that can be used as well as the corresponding SQL code 117 \begin{description*} 118 \item [Enumeration] \hfill \\ 119 \crealplisting{SQL} 120 \begin{lstlisting} 121 `D_C_UNDERG` int(11) DEFAULT NULL COMMENT 'ENUMERATION', 122 \end{lstlisting} 123 If you add such fields, then you must also fill the list of supported values (see section~\ref{sec:attribute-values}). 124 \item [Text] \hfill \\ 125 \begin{lstlisting} 126 `DESCRIPT` varchar(255) DEFAULT NULL, 127 \end{lstlisting} 128 The number next to the keyword varchar indicates the maximum text length. 129 \item [Integer] \hfill \\ 130 \begin{lstlisting} 131 `NUM_REF` int(11) DEFAULT NULL, 132 \end{lstlisting} 133 There is no special option for integer fields 134 \item [Float] \hfill \\ 135 136 \begin{lstlisting} 137 `TEMP` decimal(5,2) DEFAULT NULL, 138 \end{lstlisting} 139 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. 140 \item [Date] \hfill \\ 141 142 \begin{lstlisting} 143 `REF_DATE` date DEFAULT NULL, 144 \end{lstlisting} 145 There is no special option for date fields 146 \end{description*} 147 76 148 77 149 \subsection{Value domain of the attributes} 150 \label{sec:attribute-values} 151 78 152 79 153
Note: See TracChangeset
for help on using the changeset viewer.