Code dictionary

<< Click to Display Table of Contents >>

Navigation:  Attribute Properties >

Code dictionary

A code dictionary is a description of the attributes and thematic classes to a particular mapping project. It is used in the field to control the collection of attributes. It is also used when you create a thematic classification based on a particular data field and the usable line colour, fill colour, symbol type, linetype, filltype can be controlled by the definitions of the code dictionary to the created thematic classes. A code dictionary includes a list of attributes that describe the feature and the thematic class. The code sets in the code dictionary not contain the actual information collected in the field (positions and actual attribute values occurrence of a feature).

 

It is important to understand code dictionary and how it is used in the field to control mainly the attribute collection. A code dictionary prompts you to enter information on the data capture form as a pick-list. It can also limit what you enter to ensure data integrity and compatibility with your GIS system. Although a code dictionary is not always required for field work, having one does make both data collection and processing (thematic mapping) faster and easier.

 

The code dictionaries you create depend on your intended applications. Since different users have differing collection requirements, each user or group of users can design code dictionaries to suit their needs. You may have a code dictionary that specifies information about agricultural farm classes and productivity, while another user may have a code dictionary that details information about utility lines and services. Different users can obtain more useful information about their respective features with their own customized code dictionary.

 

The code dictionary is primarily text file (.CDT) next to the TopoLynx topoXplore Map file (.EXP) that contains code sets and their elements for relevant data fields of the attribute table. Values of a code set can be displayed in a drop-down list on the data capture form if the relevant data field name in the current attribute table is equal with the name of the code set.

 

Using the code dictionary's code sets on the data capture form of the current record

code_dictionary_geometry   code_dictionary_geometry_create   code_dictionary_form

 

General steps for defining a code dictionary are:

 

1.Tap on New project on the Startup options panel

 

2.dtToolAdd Add or dtToolNewLayer create a new vector layer to the map view

 

The Layers panel with the Add and the Create layer buttons

new_layer-codedict

 

3.Open the Record panel

 

The Record panel with a marked data field

record_dialog_box-codedict

 

4.Open the Data field panel or add a new data field to the data table in the  Menu  , and then tap on the [+] button in the code list to open the Code editing panel

 

The Data field panel without code set

DataField

 

Code sets can be defined only to the following data field types:

 

Byte: 1 byte length integer value. Value range: 0..255.

Short integer: 2 byte length integer value. Value range: -32768..32767.

Long integer: 2 byte length integer value. Value range: -2147483648..2147483647.

Text: Character field without size limit.

 

5.Add the codes to the code set you wish to use by entering their Code and Name, then tap on the Insert button (Description, Default colour, Default symbol are optionally)

 

The Code editing panel

CodeEditing

 

6.Close the Code editing panel by using the Close button on the panel. The defined codes now are displayed in the code list.

 

Defined code set in the code list

CodeDictCodeset

 

7.Close the Data field panel by tapping on the OK button

8.Then close the Record panel. The Saving Code dictionary file panel appears.

 

The Saving Code dictionary file panel

Saving_code_dictionary

 

9. Select a dictionary where you wish to store your project with its code dictionary and layers, and then enter the name of the code dictionary (the default name is General.cdt) and Save it.

10. Now the code dictionary file is enabled on the Settings panel > Record tab > Code dictionary

 

The enabled code dictionary file on the Record tab

code_dictionary_set_on_the_recor_tab

 

11. Before you exit TopoLynx topoXplore Save the Map, now the TopoLynx topoXplore Map (.EXP) file contains the path of the code dictionary and load it automatically when you open the project.

 

Code dictionary in the TopoLynx topoXplore Map (.EXP) file

codedict_in_the_exp_file

 

 

Editing the Code Dictionary (.CDT) file in a text editor

 

By using code dictionary during the attribute capture process you can customize the selectable values of a data field. When you edit a .CDT file in a simple text editor (e.g. in Notepad) pay attention to the following:

 

Enter the name of the data fields after the ’#’ or ’$’ signs in the row. The fields' name should not contain space, dot and comma characters. TopoLynx topoXplore will not display the codes next to '#' or '$' signs in Form view mode. The codes can be displayed in List view or Tree view modes only.  The same code set can be used for several fields if you separate fields' name by comma.

 

The ’#’ sign defines a numerical, the „$’ sign a textual code set. The codes will be followed by the possible values (description) and then the connected colour, items are separated by tabs. Colours must be entered by using 0x followed by colour code. The specification will be closed by an empty row, or a row that does not start with numerical value. Until the next ’#’ or ’$’ signs optional comments can be placed.

 

Numerical code set:

 

#        SoilSurface

1        < 20 cm        0xc0ffc0

2        20 - 40 cm        0x9bff9b

3        40 - 70 cm        0x67ca67

4        70 - 100        cm        0x349534

5        > 100 cm        0x006000

9        Water or N/A        0x8080FF

 

The data type of a field that uses a numerical code set can be numerical or textual. In case of using the Text(N) textual field type to a numerical code set, the data field will store the textual content of the code set. In case of using any numerical field type the data field will store the numeric code only.

 

Numeric field types for code sets:

Byte: 1 byte length integer value. Value range: 0..255.

Short integer: 2 byte length integer value. Value range: -32768..32767.

Long integer: 2 byte length integer value. Value range: -2147483648..2147483647.

Float: 4 byte length real value provides up to 7 decimal digits.

Double: 8 byte length real value provides up to 15 decimal digits.

 

k-tip-iconNumeric code sets can be stored as textual and even as numerical data. In that special case when a code set starts with "0" -zero and the data field type is numeric, the form will be filled as default with the related value of the "0" code.
 
Example code set:
 
#        SoilSurface
0        < 20 cm        0xc0ffc0
1        20 - 40 cm        0x9bff9b
2        40 - 70 cm        0x67ca67

 

The "SoilSurface" field code set on the form view of the current record

 

 

Textual code set:

 

$        TreeSpecies

POT        Populus tremula                0x80ffff

ACP        Acer pseudoplatanus        0x90c060

PIM        Pinus mugo                0xff80c0

ULG        Ulmus glabra                0xffc0e0

SAS        Salix spec.                0x70a0d0

 

The data type of the field that use the textual code set must be textual, numeric field types cannot be used for textual code sets!

 

The "TreeSpecies" field code set on the form view of the current record

code_dictionary_form_treespecies

 

General steps for editing an item of a code set in List view/Tree view modes are

 

1. Open the Record panel and tap on the value you wish to edit

editing_numerical-code_set   editing_numerical-code_set2

 

2. Tap and hold the stylus on the code you want to edit, the Code editing panel appears

 

 

k-tip-iconIn case you tapped under the code list in the code set dialog, the Code editing panel will appear without codes.

 

3. Edit the selected code in the Code editing panel

CodeDictNumericalCodeset

 

Context menu of the code set editor

 

Add new code: Opens the Add code, name panel to type the space separated code and name.

Edit code: Opens the Edit name panel to edit the name of the selected code.

Delete code: Deletes the selected code.

 

k-tip-iconThe path of the current code dictionary can be stored (and reloaded) in TopoLynx topoXplore Map file (.EXP) format. Suggested to store the code dictionary in the same directory with the project file and the layers.