Changeset 13


Ignore:
Timestamp:
02/20/13 16:35:52 (11 years ago)
Author:
lucsch
Message:

Updating tutorial first version describing how to prepare user data

Location:
trunk/tutorial
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tutorial/model_tutorial.tex

    r12 r13  
    7979 
    8080\subsection{Objects} 
     81\label{sec:objects} 
    8182 
    8283Edit the file user\_content.txt to add objects. They must have the following structure (See figure:~\ref{fig:objects}): 
     
    109110CREATE TABLE `layer_at1` ( 
    110111  `OBJECT_ID` int(10) unsigned NOT NULL, 
     112  -- add user attributes here -- 
    111113  PRIMARY KEY (`OBJECT_ID`), 
    112114  KEY `LAYER_ATX_FKIndex1` (`OBJECT_ID`) 
    113115) ENGINE=MyISAM DEFAULT CHARSET=utf8 
    114116\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 \\ 
     117This 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. 
     118Below are described the five attributes that can be used in a ToolMap data model as well as the corresponding SQL code 
     119\subsubsection {Enumeration}  
    119120    \crealplisting{SQL} 
    120121    \begin{lstlisting} 
     
    122123    \end{lstlisting} 
    123124    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    \subsubsection {Text} 
    125126    \begin{lstlisting} 
    126127    `DESCRIPT` varchar(255) DEFAULT NULL, 
    127128    \end{lstlisting} 
    128129    The number next to the keyword varchar indicates the maximum text length.  
    129   \item [Integer] \hfill \\ 
     130    \subsubsection {Integer} 
    130131    \begin{lstlisting} 
    131132    `NUM_REF` int(11) DEFAULT NULL,        
    132133    \end{lstlisting} 
    133134    There is no special option for integer fields 
    134   \item [Float]  \hfill \\ 
     135  \subsubsection {Float} 
    135136 
    136137    \begin{lstlisting} 
     
    138139    \end{lstlisting} 
    139140    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    \subsubsection {Date} 
    141142 
    142143    \begin{lstlisting} 
     
    144145    \end{lstlisting} 
    145146    There is no special option for date fields 
     147 
     148 
     149\subsection{Attributes values} 
     150\label{sec:attribute-values} 
     151For each enumeration field previously added in the user\_structure.sql file, it is necessary to define the allowed values. Therefore it is necessary to edit the attributes section of user\_content.txt. The structure of the Attributes section is shown in Figure~\ref{fig:attributs}. This table is divided into two parts, the first three columns describe the attribute fields, the remaining columns describe the values supported by these fields. Below is a description of each column. 
     152 
     153\begin{description*} 
     154  \item [ATTRIBUT\_ID] attribute unique ID. 
     155  \item [LAYER\_INDEX] the index of the layer that the attribute refers to. The value 1 shown in the example (Figure 4, row 42 and 43) therefore relates to the theme Boreholes\_PT. 
     156  \item [ATTRIBUT\_NAME] attribute name. This name will be used as the column name in the exported SHP. Some limitations apply to SHP format for column names, for more information you can refer to \url{http://en.wikipedia.org/wiki/Shapefile#Shapefile\_attribute\_format\_.28.dbf.29} or \url{http://www.gdal.org/ogr/drv\_shapefile.html}  
     157  \item [CATALOG\_ID] attribute value unique ID 
     158  \item [CODE] attribute value code, should not necessarily be unique 
     159  \item [DESCRIPTION\_0,1,2,3,4,5] attribute value description in up to 5 languages. The order of language is not important, but it must be identical to the one chosen for the objects (see~\ref{sec:objects}). 
     160 
    146161\end{description*} 
    147162 
    148  
    149 \subsection{Value domain of the attributes} 
    150 \label{sec:attribute-values} 
     163\begin{figure} [htbp] 
     164        \centering 
     165    \includegraphics[width=.9\textwidth]{img/attributs.png} 
     166    \caption{Attributes section structure} 
     167    \label{fig:attributs} 
     168\end{figure} 
    151169 
    152170 
Note: See TracChangeset for help on using the changeset viewer.