Changeset 14 for trunk


Ignore:
Timestamp:
02/20/13 17:18:13 (11 years ago)
Author:
lucsch
Message:

Updating tutorial first release version describing how to prepare user data

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tutorial/model_tutorial.tex

    r13 r14  
    2121This tutorial explains how to create a ToolMap project manually. This approach has the following advantages: 
    2222\begin{enumerate*} 
    23   \item It ensures the IDs used 
    24   \item It generates a multilingual model 
     23  \item It ensures that the ID remain consistent 
     24  \item It could generate a multilingual model 
    2525  \item It allows better monitoring of model changes 
    2626\end{enumerate*} 
     
    4545 
    4646\section{Data needed} 
    47 In order to produce a ToolMap project, TmDmCreator needs the following files: 
     47In order work, TmDmCreator needs the following files: 
    4848%\begin{itemize} 
    4949    \begin{description*} 
     
    5555The recommended way to work with user\_structure.sql and user\_content.txt is described below 
    5656 
    57  
     57\clearpage 
    5858\section{Preparing user data} 
    5959 
     
    7070  \item [LAYER\_NAME] the layer name. This name will be given to the SHP file when exporting 
    7171\end{description*} 
     72 
     73Make sure you choose an Unicode format (Unicode Text (*.txt) or UTF-16 Unicode Text (*.txt)) when saving from the spreadsheet. 
    7274 
    7375\begin{figure} [hbp] 
     
    8688  \item [OBJECT\_CD] object code, should not necessarily be unique 
    8789  \item [OBJECT\_TYPE\_CD] object spatial type, uses same values as those described above for TYPE\_CD in thematic\_layers 
    88   \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. 
     90  \item [THEMATIC\_LAYERS\_LAYER\_INDEX] the index of the layer that the object refers to. The value 1 shown in the example (Figure~\ref{fig:objects}) therefore relates to the theme Boreholes\_PT. 
    8991  \item [OBJECT\_DESC\_0,1,2,3,4,5] object description in up to 5 languages. 
    9092  \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. 
     
    103105 
    104106\subsection{Attributes structure} 
    105 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: 
     107Edit the file user\_structure.sql with Notepad (or even better with Notepad + +). For each layer containing attributes, there must be a SQL code of the type: 
    106108 
    107109\crealplisting{SQL} 
     
    117119This 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. 
    118120Below are described the five attributes that can be used in a ToolMap data model as well as the corresponding SQL code 
    119 \subsubsection {Enumeration}  
     121\subsubsection {Enumeration} 
     122\label{sec:enumeration} 
    120123    \crealplisting{SQL} 
    121124    \begin{lstlisting} 
     
    149152\subsection{Attributes values} 
    150153\label{sec:attribute-values} 
    151 For 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. 
     154For 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. 
    152155 
    153156\begin{description*} 
    154157  \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. 
     158  \item [LAYER\_INDEX] the index of the layer that the attribute refers to. The value 1 shown in the example (Figure~\ref{fig:attributs}, row 42 and 43) therefore relates to the theme Boreholes\_PT. 
    156159  \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}  
    157160  \item [CATALOG\_ID] attribute value unique ID 
Note: See TracChangeset for help on using the changeset viewer.