Home
 

Data

Input 1 Working map
Output Continuous data
or Discrete data
or Qualitative data
or Alphabetical data
or Continuous matrix
or Discrete matrix

Display :

Description :
The objective of this module is to enter data that the user wants to work on into the diagram.

You have five possibilities which correspond to the five choices of the combo box :

  • Choosing a text or DBF file containing statistical data. For this, select the Text File choice, and then click on the Choose the file button. Using the Column and header button, you can select the desired column and specify whether the first line of the file is a heading line.
  • Choosing an Excel file containing statistical data. For this, select the Excel choice, and then click on the Choose the Excel file button. Using the Choose the sheet, Column of identifiers and Column of data buttons, you can select the desired data, and specify whether the first line of the file is a heading line using the Use header as column name box.
  • Selecting data from the records of a 4D database. To do this, select the 4D Database choice, and then fill in the Table name, Field name and Identifier field fields corresponding to the 4D database you want to use (the base must be opened with the Cartes & Données Plug-In).
  • Selecting data from the records of an ODBC source. To do this, select the ODBC choice, and then fill in the ODBC source name, Login and Password fields corresponding to the ODBC source you want to use. Then fill in the Request field to make your selection.
  • Keeping the data in the diagram, by selecting the Internal choice.

You can create a new file containing the data at any time (whatever its source). To do this, select the Text File choice, and then click on the Create a new file button, and give it the desired name.
ATTENTION: if you have just placed your module in the diagram, it does not contain any data, so the file creation will not be successful. It must be connected to the working map module upstream for the module to be able to create data. This will enable the file to be created correctly.

If the Text File choice has been selected, the file under consideration will be saved after each manual data entry using Cartes & Données.
If the Excel or 4D Database or ODBC choice has been selected, the data is not modifiable.

By checking the Automatic module name box, the name of the module in the diagram will be selected automatically, and you will not be able to modify it yourself (unless the data are internal). This name will be:

  • either that of the file selected, followed by the number of the column chosen.
  • or the name of the column if the file has a heading line.
  • or the field name for 4D databases.

Types of Data :
Here is a list of the various types of data:

  • Continuous data (figures)
  • Discrete data (class numbers)
  • Qualitative data (names)
  • Alphabetical data (names)
  • Continuous matrix (figures in a matrix)
  • Discrete matrix (class numbers in a matrix)

During data entry in Cartes & Données tables, of whatever type, the value "----" (four dashes) corresponds to a non-valid value. This enables one or more entities to be excluded from data processing.

Selection of a Text or DBF file :


  • The file can be in dbf or ASCII (text) format.
  • If the file is in ASCII (text) format , 2 items of information must appear on each line:
         - The identifier for the geographical entity.
         - The value.
  • These items of information must be separated by tabulations. The identifier must be identical to that of the "working map" file.
  • In the same way as for the "NUM" format, if there is a dash in the identifier, it separates the identifier from the entity name (see the description of formats in imports / exports).
  • A data file can contain as many columns as desired.
  • ATTENTION: if the first line is a heading, the first field of that line must not be empty (put an asterisk in for example).
  • If the data is a matrix, it can be written in 2 ways : squared matrix or one column (see below chapter about matrix)

File location:
In the Options/Preferences menu, you can choose a data directory. If the file is under that directory or any subdirectory, it is considered to be relative.

  • We recommend that all the documents (maps, data, diagrams) be placed in this directory.
  • We do not recommend ever changing this directory, because it is used as a reference for all the relative files.
  • If two persons have Cartes & Données, they can exchange diagrams very easily if they have been careful to place their data in the directory using a similar directory hierarchy. This is the case even if one is using a Macintosh and the other a PC.

Selection of a file containing several columns:
If the file contains several columns, click on the Column and header button to choose the desired column. You will then see a window of the following type appear:

by default, the first column is always selected. To choose another, you just have to click on the title of the desired column (the cross will then appear in this column).

If your file has a heading line, check the Use header as column name box:

If the Use header as column name box has been checked, Cartes & Données uses the first line to rename the module.

Selection of an Excel file :




  • The xls file can be in Excel95, Excel97 or ExcelXP format.
  • The file must contain one column with the identifiers for the geographical entities. The identifiers must be identical to that of the "working map" file.
  • In the same way as for the "NUM" format, if there is a dash in the identifier, it separates the identifier from the entity name (see the description of formats in imports / exports).
  • The data file can contain as many columns as desired.
  • If the data is a matrix, it can be written in 2 ways : squared matrix or one column (see below chapter about matrix)

File location:
See the paragraph File location in the chapter Selection of a Text or DBF file.

Selection of the sheet :
Click on the Choose the sheet button to choose the sheet containing the desired data. You will then see a window of the following type appear:

By default, the first sheet of the file is always selected. To choose another one, you just have to click on the name of the desired sheet (the cross will then appear in front its name).

The name of the selected sheet is displayed on the right of the Choose the sheet button.

Selection of columns:
Click on the Column of identifiers and Column of data buttons to choose the desired columns. You will then see a window of the following type appear:

By default, the first column is always selected for identifiers, and the second one for data. To choose another one, you just have to click on the desired column (it appear in blue).

Click then on next to display this new page :

If your file has a heading line, check the Use header as column name box.

If the Use header as column name box has been checked, Cartes & Données uses the first line to rename the module.

Data from 4D databases :



The Field name must correspond to a field in the table containing the required data item.
The Identifier field must correspond to a field in the table containing the identifiers of the associated working map.

ATTENTION: there must be only one Plug-In on the machine. If several 4D databases are open and each one has a Plug-In, the parameter transfer will not be carried out correctly.

The Plug-Ins and Cartes & Données accept the following 4D types, as a function of the Cartes & Données types:

C&D Types

4D Types

Continuous Data Numerical
Discrete Data Integer or Long Integer
Alphabetical Data Alpha
Qualitative Data Alpha
Continuous Matrices Numerical
Discrete Matrices Integer or Long Integer

The matrix data must be stored in a single column, with "Departure>Arrival" as identifier. For example, for French departments, we can have a table as below:

Identifier Value
95>12 10
17>34 20

These values show that the flow between the departments 95 and 12 is 10, and the flow between 17 and 34 is 20.

The following error messages may appear during program execution:

1000 Call function incorrect
1001 Key field not found
1002 Type of key field not valid
1003 Value of key field not valid
1004 Value of key field not found
1005 Data field not found
1006 Type of data not valid
1007 Data not found
1008 Cannot recover value
1009 Cannot move on to next record
1010 Cannot find end of selection
1011 Cannot change the data
1012 Cannot store record
1013 Cannot create a record
1014 Field empty
-1000 Cannot decode information received from the Plug-In
-1001 The Plug-In was not able to decode the information sent
-1002 Internal transmission error

Data from an ODBC source :




The text in the Request zone must be written in the SQL format.

Here is the pattern:
  select idfield, datafield from table where field>5
where :

  • table is a table of the selected ODBC source.
  • idfield is a field of table containing the identifiers of the associated working map.
  • datafield is a field of table containing the required data item.
  • Optional : the word "where" allows you to specify one or more conditions.
     Example : "where field1>100 and field2<200"
      where field1 and field2 are fields of table.
If the identifier is a multiple key (identifier made of several fields, separated by '/' for example), the result of the request must be made of two columns : identifier followed by the data (as in the simple identifier case). Here is the particular pattern:
  • if the ODBC source is an Access database:
      select idfield1+'/'+idfield2+'/'+idfield3, datafield from table

  • if the ODBC source is a mysql database:
      select concat(idfield1,'/',idfield2,'/',idfield3) as multiplekey, datafield from table

ATTENTION: you must follow the order identifiers field, data field. The request will generate an error otherwise.

Once you have written your request, you must select the data type of the result, and then click on the OK or Apply button to execute your selection.

Like in 4D database case, the matrix data must be stored in a single column, with "Departure>Arrival" as identifier.

Types of Data:

Discrete data :
A discrete data item must be an integer between 1 and 512.
However, special treatment is given when the smallest value is other than 1: for example, if the classes are between -15 and 2 , in Cartes & Données they will be converted to between 1 and 18, and the whole range will be shifted.

Qualitative data :
If you select a qualitative data item, and the Internal choice has been selected, you can modify the number of qualities by clicking on the ' + ' or ' - ' buttons to be found alongside the number of qualities. The names of the qualities then appear in the table above the buttons. By default, these are figures, but you just have to click on them to rename them, and use the "Downward arrow" or "Tabulation" keys on your keyboard to validate each entry. The maximum number of qualities usable is 512.

When data are entered in a Cartes & Données table, a list of qualities is proposed, whatever the origin of the data. You can scroll the list of qualities using the mouse or the keyboard ("Right arrow" and "Left arrow" keys). This enables you to select a quality, or create a new one.

Matrix :
A flow matrix is a set of statistical data concerning migratory flows between geographical entities. Each line of the matrix represents movements from one entity to all the others. The matrix is square, and the original working map is the same as that of the destinations.
The first column must contain the identifiers.
The first line can contain:

  • Either data. The columns are then supposed to be in the same order as the lines.
  • Or identifiers. The columns can then be in any order. You must check the Use the header as column name box, which is accessible by clicking on the Column and header button.

The matrix must always be square (not counting the headings).

Examples of matrices (with three objects A, B and C):

 A  -  2  -
 B  1  -  1
 C  -  1  -

equals:

 -  B  A  C
 A  2  -  -
 B  -  1  1
 C  1  -  -

Matrix described with one column :
It is possible to describe the matrix with one column, instead of a squared matrix NxN. The option Column Matrix must be set in the "File" choice. For 4D and ODBC, only the mono-column matrix is allowed, thats why there is no option.
This is a sample file

A>B    2
B>A    1
B>C    1
C>B    1

More than one data column is allowed. But the name of objects cannot be present, only their identifiers.

Script:

2      module untyped_list ""
3        mod_type integer "102"
3        mod_subtype integer "0"
3        mod_name string "PSDC82"
3        mod_dads integer_list ""
4          ? integer "4"
3        path path ""
4          file_type integer "-1"
4          type integer "4"
4          win32_net boolean "F"
4          volume string ""
4          path_elem string_list ""
5            ? string "FRANCE"
5            ? string "DPT"
5            ? string "MULTI.DPT"
3        absolute boolean "F"
3        base_path path ""
4          file_type integer "-1"
4          type integer "2"
4          win32_net boolean "F"
4          volume string "D"
4          path_elem string_list ""
5            ? string "develres"
5            ? string "Lib_html"
5            ? string "scripts"
3        auto_name boolean "T"
3        linked_to_file boolean "F"
3        column_nb integer "3"
3        squared_matrix boolean "F"
3        has_header boolean "T"
3        output_type integer "2"
3        data_list untyped_list ""
3        qualities string_list ""
3        linked_to_xls boolean "T"
3        xls_path path ""
4          file_type integer "-1"
4          type integer "4"
4          win32_net boolean "F"
4          volume string ""
4          path_elem string_list ""
5            ? string "france"
5            ? string "dpt"
5            ? string "multi.xls"
3        absolute_xls boolean "F"
3        col_id integer "1"
3        col_data integer "4"
3        sheets string_list ""
4          ? string "Feuille1"
4          ? string "Feuille2"
4          ? string "Feuille3"
3        sheet_name string "Feuille1"
3        xls_squared_matrix boolean "F"
3        xls_has_header boolean "T"
3        linked_to_4d boolean "F"
3        table_name string "DEPARTEMENTS"
3        data_name string "POP"
3        key_name string "CODE"
3        linked_to_odbc boolean "F"
3        src_name string "POPULATION"
3        src_login string ""
3        src_psswd string ""
3        request string "select CODE,DENSITE from DEP where DENSITE>100"

Values for output_type:
Continuous data             2
Alphabetical data           5
Discrete data               9
Qualitative data           10
Continuous matrix          11
Discrete matrix            12
Qualitative matrix         13

Case of Internal choice selection:
In this case, the 'data_list' must contain the data entered on the screen.
For example, for data of alphabetical type:

3        data_list untyped_list ""
4          ? untyped_list ""
5            id string "80"
5            val string "North"
4          ? untyped_list ""
5            id string "83"
5            val string "South"

The type of data for the 'val' field is:
 - 'double' for continuous data or matrices.
 - 'integer' for discrete data or matrices.
 - 'string' for qualitative or alphabetical data.
The 'id' field contains the identifier of the entity concerned.
In the case of matrices, we place in this field the identifiers of departure and arrival
separated by a ">". Example : "80>83".

Only entities containing data should be inserted.
The others are considered to be non-valid.

Case of qualitative data:
If the data are qualitative, and the Internal choice is selected,
the  'qualities' list must be supplied. Example:

3        qualities string_list ""
4          ? string "Electronics"
4          ? string "Textile"