60. Add a table

60.1. Introduction

There are two ways to add a table of gvSIG:

Open the attribute table of a layer. From a active layer of a view, clicking on button “Show attribute table” or in menu “Layer/show attribute table”.

Menu

Button

  1. Add a new table from “Projects Manager”:

    1. Select the table icon.

    2. Click on button “New”. The window to add the table is opened, allowing select database source “File” or “DB” (database).

    1. With button “Delete” of Project Manager the selected tables are eliminated.

    2. With the button “Open” of Project Manager the selected tables are opened.

60.2. Add a file

In “File” tab, if we click on button “Add” will open a new window that allow us to navigate to the file we want to add.

Added the file we’ll see how it’s listed. To modify load parameters of the table we need to select the layer on the list and click the button “Properties”.

A new window with two tabs will be opened: “Basic” and “Advanced”. The property that can be more useful from all to the correct visualization of the data are “Encoding” and “locale”.

Clicking “OK” the tables will be added to the project.

60.3. Add a database

Allow access to user to databases in a simple and unified way to different providers.

gvSIG will store different connections that are been made in different sessions. This manner it’s not necessary introduce again parameters of each server to what we’ll connect. Same way, if we open a project file that have one database connection will be just asked us the password.

The steps to add a table of a DB are:

  • Establish connection.

    • Select the tab “DB”.

    • Click the button to create a new connection. If there are existing connections we just need to select them from dropdown. When created a new connection it’s opened this tab:

    • We indicate connection parameters:

    1. Connection name: user’s choice.

    2. Connector. We select from the dropdown database type that we want to connect (MySQL, PostgreSQL, JDBC).

    3. Server: URL from server.

    4. Port.

    5. Database: database name.

    6. User.

    7. Password.

    • Click “OK” and the connection will be established. When established, the tab “New table/DB” show the available ones.

  • Selection of information.

    • We select table/s we want to load. When a table is selected, box “Table’s columns” will be updated showing selected all fields available from it’s attribute table; we can unselect those we don’t want to load.

    • Table’s configuration. In this box we can change the name that the table will show (by default the same name of the table). Allow to indicate a restriction with a SQL expression and select field ID.

  • When defined all fields we click “OK” and the tables will be added to the project.

60.4. Add a CSV file

AllowThis type of file can be opened as a table (from the document table) or layer (from the document view).

To add it as table, being in the "File" tab, click the "Add" button and a new window will be shown that allow us to navigate until the CSV file we want to add.

To add it as layer, being in a view, click the "Add layer" tool and inside the window that opens choose the "Add" button. A new window will appear that allows us to navigate to the CSV file you want to add.

This format type can be properly displayed or not based on parameters series that need to be defined. To define these parameters the table must have been selected from the list and press the "Properties" button. It will open an importer (wizard) that will guide us in the definition of such parameters.

The importer has two main tabs:

  • General: It includes parameters to define the table display, such as the play's characters, regional settings, etc.

  • Geometry: It is only displayed if we load the CSV as a layer. It will allow to define which fields contain the coordinates from which will be created the new graphics layer.

The parameters that are displayed are:

  • Set of characters. Selectable via a drop-down list.

  • Regional settings. Selectable via a drop-down list.

  • First line as header. Activating the verification box, the first line of the table is used as header or table header.

  • From the line. It will be imported for us from the specified line number.

  • Character for the starting a comment. It allows to ignore possible comments on the table indicating the existing character at the beginning on each one.

  • Ignore errors. By activating the verification box the table will load ignoring possible found errors.

  • Separator options. It allows to define the column separator characteristics. For each change to be made, user must then press the "Preview" button to display the result.

  • Columns. It allows you to define the columns characteristics.

  • The "Options" button allows you to save and load the importer parameters.

The geometry tab allows you to define values for X, Y, Z that contains the CSV and add it as a layer. The needed columns to add the layer are the X and Y ones.



This Page