11. Adding layers

11.1. Introduction

A layer is a dataset with geographical information which might be stored in different formats: vectorial or raster files, remote services, databases... (See “Supported formats”).

There are different options to add a layer to a gvSIG View:

  • With “Add layer”, clicking on the “Add layer” button or in the menu “View/Add layer”.

Menu

Button


  • Copy/Cut a layer from another View. With a right-click on the layer you can access to the contextual menu with options to “Copy” or “Cut” a layer. With a right-click on the View's TOC where we want to paste it, we access to the option “Paste”.

  • Drag and drop a layer from a file browser to the gvSIG View.

When using the order “Add layer” in one session, gvSIG will automatically return to the same location from where data for the View was selected.

When the layer is added a window with different tabs is opened.

Each tab belongs to a different datum:

  • File: data stored in files (shp., dxf., tiff., asc...)

  • Acces services to remote data according to OGC, WMS, WCS, WFS, WMTS standards.

  • GeoDB: Vectorial data in spatial databases.

  • OSM: Access services to OpenStreetMap images (tiles).

  • PostGIS Raster: Raster data stored in a PostGIS database.

11.2. Adding a file

In the “File” tab, if we click on “Add” a new window appears. In here we can search the file we want to add.

Once the file is added it appears a list where the file name is indicated and its CRS. By default gvSIG interprets that the CRS is the same as the View, To modify the CRS the layer must be selected in the list and we click on “Properties”.

A new window is opened where there are two tabs “Basic” y “Advanced”. Between all the properties available the most used is “CRS”.

Once we defined the CRS, clicking on “OK” the layers will be added to the View.

Clicking the “...” button of CRS we will be able to access to a window where we can select the reference system. This window is similar to the one for selecting the reference system in a View (See “Coordinate system” to get more information), except the option to select a transformation.

When selecting a CRS for a layer different to the CRS for the View, gvSIG automatically makes a reprojection of the layer.

Reprojection is on-the-fly (OTF). This means that the layer keeps its original projection without any change. If we want to create a new layer with a different projection we will use the “Reprojection” geoprocess (See “Geoprocessing”).

Transformation and conversions

According to the 19111 ISO, there are two types of operations to relate two different CRSs: conversion operations and transformation operation.

A coordinates conversion operation is applied when the CRS datum of the layer is the same as the CRS datum of the View, that is, both CRS belong to the same geodesic reference system but they are in different coordinates systems. In this case, when choosing the layer CRS we must select the option “No Transformation”.

A coordinate transformation operation is applied when the CRS datum of the layer is not the same as the CRS datum of the View. In this case there are two types of coordinates operations:

  • That the operation just involve a transformation, when the CRS coordinate system of the layer is the same as the CRS coordinate system of the View; in both CRSs the position is expressed in the same coordinates system but in a different datum.

  • That a transformation and a conversion are made because neither the datum, neither the coordinates system of the CRS of the layer and of the View are the same.

If a transformation operation is needed, we must choose the type of transformation in the CRS selection panel of the layer, and click the “Next” button, accessing to a panel where we choose the corresponding transformation.

The transformation dialog depends on the type of transformation we want to apply.

EPSG Transformation

Official transformation operations with 7 parameters defined in the repository EPSG. In the dialog of this type of transformation there is a table which includes all the applicable transformations of the EPSG taking as source CRS the one which was chosen for the layer and the CRS of the View as destination CRS.


You must take into account that the transformation operations of this type are always between the base CRS, that is, non-projected CRS, and therefore if the CRS of the view or the CRS of the layer is projected, the corresponding base CRS will appear in the fields Source CRS and Destination CRS. Keep also in mind that for this type of transformation, the CRS for the View and the CRS for the layer must come from the same EPSG repository. If they come from different repositories, the table will appear empty.

Manual Transformation

It allows users to define a Helmert transformation through the introduction of its 7 parameters.

Grid NTv2

Transformation based on an NTv2 grid file. For this, you must choose the NTv2 file from a list of available files or import it from a location to be specified. Since in the NTv2 file the translations have been calculated in a given base CRS, you must indicate here whether the NTv2 was calculated in the base CRS of the View, or the base CRS of the layer.

The grid file has a specific scope, which can be deduced from the file information that is displayed in the processing panel. Transformation is not applied beyond this scope, so the re-projection accuracy will be considerably lower, since only the corresponding coordinate system conversion would be applied.

Recent Transformations

With this application you can select a transformation that has been used previously.

If a recent transformation is selected, two actions can be taken: to accept the transformation or to click on the “Next” button to review the selected transformation. In the next panels you access to the information of the chosen transformation, where you can modify it or select a different one.

Composite transformations

It provides gvSIG users with the possibility to represent two CRS with different datums without the transformation between those two CRS, but with a transformation of those two CRS into a third CRS.

In this case, the composite transformation can play an important role when you need to define two transformations, one that refers to the CRS of the layer and the other to the CRS that has been defined for the view.

With this mechanism, you can set the CRS for the layer and the CRS of the View through an intermediate CRS that connects the two CRS.

To do this, after selecting the CRS of the layer and setting the type of transformation to Compound transformation, you need to:

  1. Define the transformation to be applied to the CRS of the layer

  2. Define the transformation to be applied to the CRS of the view

11.3. Adding a WMS

The steps to add a WMS through the “Add layer” window are:

  1. Connecting to the service

    1. Select the “WMS” tab.

    2. Introduce the server URL, which will be stored and it will be shown in the pull-down menu for the future.

    3. Click on “Connect”.

    4. When the connection is made, a welcome message from the server appears (not always).

    5. The WMS version number that the connection has been made to is shown at the bottom of the box.

    6. When the connection is made the “Next” button is enabled. We click on it to begin with the configuration of the layer.

      You can select the “Refresh cache” option which will search for the server information in the local host. This will only work if the same server was used on a previous occasion.

  2. Information. It shows information from the server.

    1. Click on “Next”.

  3. Layers. It allows users to access to the available layers in the WMS server and select the one you wish to load.

    1. The available layers are shown. We select the ones we want for our WMS layer. We can double click on a layer and it will be automatically add...

    2. ... or to click on the “Add” button.

    3. List of layers that we are adding. We can change the order in which they appear using the up/down arrows.

    4. You can select to keep the structure of the layers and to display their name.

    5. Name that the layer will have in the TOC.

    6. Click on “Next”

        You can select several layers at once by holding down the “Control” key whilst left clicking on the mouse.

        You will obtein a layer description if you move the cursor over a layer and wait for a few seconds. The information the server has about these layers is shown.

        If we add a folder, the WMS will have all the layers in that folder.

  4. Styles. It allows you to choose between the different types of styles (Symbology) that are available. It can happen that there is only one defined style or that the tab is disabled.

    1. Click on Next.

  5. Dimensions. It helps to configure the value for the WMS layer dimensions. However, the dimensions property (like the styles property) is optional and may be disabled.

    1. Initially, no dimension is configured. It allows users to select one from the “Settings editor” area in the list of dimensions. The controls in the bottom right-hand corner of the tab are enabled.

    2. Use the slider control to move through the list of values the server has defined for the selected dimension. You can move back to the beginning, one step back, one step forward or move to the end of the list using the navigation buttons which are located below the slider control.

    3. If you know the position of the value you require, you can simply write it in the text field and it will move automatically to this value.

    4. Click on “Add” so that you can write the selected value in the text field and request it to the server.

      gvSIG allows you to choose between:

    • Single value: Only one value is selected

    • Multiple: The values will be added to the list in the order they are selected in.

    • Interval: An initial value and then an end value are selected.

    1. When the expression for your dimension is complete, click on “Set” and the expression will appear in the information panel.

          Although each layer can define its own dimensions, only one choice of value is permitted (single, multiple or interval) for each variable.

          The server may come into conflict with the layer combination and the variable value you have chosen. Some of the layers you have chosen may not support your selected value. If this occurs, a server error message will appear.

          You can personalise the expression in the text field. The dialogue box controls are only designed to make it easier to edit dimension expressions. If you wish you can edit the text field at any time.

  1. Formats. Selecting the format, coordinate system and text format.

    1. It allows you to choose the image format. The main difference between formats is the capacity they have to support transparencies (for instance, PNG supports transparency, JEPG shows transparency areas in an opaque white.

    2. It allows you to choose the CRS for the layer. It should be similar to the one from the View.

    3. It allows you to choose the text format for information queries.

    4. Click on the “OK” button and the layer will be added to our View.

      WMS can have as a feature an associated legend. In this case the legend will be shown in the TOC.

11.4. Adding a WMTS

The steps to add a WMTS through the “Add layer” window are:

  1. Connecting to the service.

    1. Select the “WMTS” tab.

    2. Introduce the URL server. The URL will be stored and it will be shown in the drop-down box for other occasions.

    3. Click on the “Connect” button.

    4. When the connection is made, a welcome message from the server appears (not always).

    5. The information about the type of server with which the connection has been made to is shown at the bottom of the box.

    6. When the connection is made the “Next” button is enabled. Click on it to start with the configuration of the WMTS layer.

      You can select the “Refresh cache” option which will search for information from the server in the local host. This will only work if the same server was used on a previous occasion.

  2. Information. It shows the service information.

    1. We click on the “Next” button.

  3. Layers. It allows you to access to the set of available layers in the WMTS server and to choose the one you want to add to the View.

    1. We select the type of View: view as a layer list or view as a theme.

    2. The list of the available layers is shown. Double-click on a layer and it will automatically be added.

    3. ... or click on “Add”.

    4. Name of the added layer.

    5. Click on “Next”.

  4. Styles. It allows you to choose between the different types of styles (Symbology) that are available. It can happen that there is only one defined style or that the tab is disabled.

    1. We choose the style.

    2. We click on “Next”.

  5. Formats. Choosing the format, coordinate system and text format.

    1. It allows you to select the image format.

    2. It allows you to select the CRS of the layer. It should be similar to the one from the View.

    3. It allows you to select the text format for information queries.

    4. Click on “OK” and the layer will be added to the View.

11.5. Adding a WFS

The steps to add a WMTS through the “Add layer” window are:

  1. Connecting to the service.

    1. Select the “WFS” tab.

    2. Introduce the URL server. The URL will be stored and it will be shown in the drop-down box for other occasions.

    3. Click on “Connect”.

    4. When the connection is made, a welcome message from the server appears (not always).

    5. The information about the type of server with which the connection has been made to is shown at the bottom of the box.

    6. When the connection is made the “Next” button is enabled. Click on it to start with the configuration of the WFS layer.

      You can select the “Refresh cache” option which will search for information from the server in the local host. This will only work if the same server was used on a previous occasion.

  2. Information. It shows the server information.

    1. Click on “Next”.

  3. Layers. It allows you to access to the set of available layers in the WFS server and to choose the one you want to add to the View.

    1. Double-click on the layer you want to add to the View.

    2. Name with which the layer will be displayed in the TOC.

    3. Information about the WFS version.

    4. Click on “Next”.

  4. Fields.

    1. It allows you to select the fields which will make the attributes table associated to the selected layer.

    2. Click on “Next”.

  5. Options.

    1. WFS version

    2. Max. Features: It allows users to set a maximum number of entities that can be downloaded. Timeout is the length of time beyond which the connection is rejected as it is considered to be incorrect. If these parameters are very low, a correct request may not obtain a response.

    3. SRS: CRS of the layer. gvSIG reprojects the loaded layer to the spatial system in the view.

    4. Enable cache.

    5. Invert the order of X/Y axis.

    6. Inform about the WFS version.

    7. Once the parameters are selected, Click on “Next”.

  6. Area

    1. It allows you to delimit the area of the View in which the vectorial elements will be downloaded. The validation button allows you to confirm that the coordinates are correct (when you click on it, if the X Ycoordinates tabs have right values they become green)

    2. After this we click on “OK” and the WFS will be added to the View.

11.6. Adding a WCS

The steps to add a WCS through the window “Add layer” are:

  1. Connecting to the service

    1. Select the “WCS” tab.

    2. Introduce the URL server. The URL will be stored and it will be shown in the drop-down box for other occasions.

    3. Click on “Connect”.

    4. When the connection is made, a welcome message from the server appears (not always).

    5. The information about the type of server with which the connection have been made to is shown at the bottom of the box.

    6. When the connection is made the “Next” button is enabled. Click on it to start with the configuration of the WCS layer.

  2. Information.

    1. Click on “Next”.

  3. It allows users to access to the set of available layers in the WCS server and to choose the one you want to add to the View.

    1. Double-click on the coverage you want to add to the View.

    2. Click on “Next”.

  4. Formats. It allows users to choose the image format with which the request will be made and the reference system.

    1. Select the format.

    2. Select the CRS. It must coincide with the CRS of the View.

    3. Click on “Next”.

  5. There are tabs such as “Time” and “Parameters” that can be disabled or enabled depending on the service.

  6. Click on “OK” and the WCS will be added to the View.

11.7. Addin a OSM service

The steps to add an OSM service by means of the window "Add layer" are:

  1. Select “OSM” tab.

  2. Select one of the tile services available in OSM (Mapnik, Stamen Watercolor, Open Cycle Map, Stamen Toner, Stamen Terrain)

  3. When we select a service from the list its characteristics are automatically filled in. In this section we can also add a new server’s features or update an existing server.

  4. Click on “Ok” and OSM layer is added to View

11.8. Adding web maps (Google Maps / Bing Maps)

This tool adds a map service like Google Maps or Bing Maps to View. It uses the projection system EPSG: 3857; therefore, in order to obtain a correct visualization of the data, it is recommended that View must be in the same projection.

The steps to add a map service from the window Add Layer are the following:

  1. Select the Tab “WebMaps

  2. Select the Tab of the map service of preference (Google Maps o Bing Maps)

  3. Select the type of map from the drop down menu

  4. Indicate (optional) the API key

    1. Google Maps: This tool uses the library of static maps of Google Maps; hence, it must follow these terms of use: (https://developers.google.com/maps/terms?hl=es#1-your-relationship-with-google). For this, it is necessary to use a credential that identifies the service used. This credential is obtained from Google and must be set up before using it with static maps. The credential must be obtained from: https://console.developers.google.com/

    2. Bing Maps: This tool uses the library of static maps of Bing Maps; hence, it must follow these terms of use: (https://msdn.microsoft.com/es-es/cc300389). For this, it is necessary to use a credential that identifies the service used. This credential is obtained from Bing and must be set up before using it with static maps. The credential must be obtained from: https://www.microsoft.com/maps/create-a-bing-maps-key.aspx

    3. Set (optional) the zoom level. This field indicates the number of zoom the layer allows. Although it is predetermined at 22 in Google Maps, this is a default value and may change depending on the zone and the type of map used, so other values might be necessary. In Bing Maps, it is not necessary to use zoom level because it is provided by Bing Maps according to the type of layer

    4. Click OK and the new layer is added to View

11.9. Adding a spatial database (GeoDB)

It allows the user to access spatial databases in a simple and unified way to different suppliers.

gvSIG stores the different sessions’ connections. This way is not necessary to enter the parameters of each server to which we connect every time. Similarly, if you open a project file that has some connection to databases we only will be asked for the password.

The steps to add a GeoDB layer to the View are:

  1. Connect:

    1. Select “GeoDB” tab.

    2. Click on the button to create a new connection. If there already created connections we simply select it from the drop-down. When we create a new connection the following window opens:

    3. We indicate the connection parameters:

    • Connection name: user’s choice

    • Connector. Select the type of database which we want to connect to from the drop down menu (MySQL, PostgreSQL/PostGIS, JDBC).

    • Server: Server URL

    • Port.

    • Database: database name

    • User

    • Password

    1. Click on “OK" and the connection will be established. When connected, the window "Add Layer / GeoDB" shows the tables (layers) available.

  1. Selection of information

    1. Select the table / to load. When we select a table, the "Table Columns" section will be updated showing all selected fields available in our table; we can unselect those we don't want to load.

    2. Table settings. In this section we can change the name of the layer displayed in the TOC which is filled by default with the name of the table. It allows indicating a restriction by means of a SQL expression, design and work area.

  2. Once all the parameters are set click on "OK" and the information will be added to our Vista.

11.10. Adding PostGIS Raster

It allow to add raster information stored in PostGIS database. Its behaviour is similar to GeoDB

  1. Connect.

    1. Select “PostGIS Raster” tab.

    2. Click on the button to create a new connection. If there are connections already created we must select from the drop-down. When the connection is established the following window opens:

    3. We indicate the connection parameters:

    • Connection name: user's choice

    • Connector. Select the “PostgreSQLExplorer” option from the dropdown:

    • Server: Server URL

    • Port.

    • Database: database name

    • User

    • Password

    1. Click on “OK” and set connection. When we connect, the window "Add Layer / PostGIS Raster" displays the avaiable tables.

      1. Select a table from the list and the “Subdataset” paragraph will update.

      2. Click on “OK” and our View information will be added.

11.11. Add event layer

It allows to create a point layer from a table which has the points X and Y coordinates as fields. We must have a table in the project to run this tool.

It is available in the "View / Add event theme" menu, in the "Tools / Transforms / Create" menu and from the corresponding button.

Icono

Herramienta

Tecla rápida

Descripción

Add event theme


It allows to create a point layer from a table which has the points X and Y coordinates as fields

The interface will guide us through the steps to add a event theme

  1. Select data store. It allows the selection of the table we want to add as a layer of events from the available table lists of our project. Once selected we must click on the "Next" button.

  2. Select the transformation parameters. It allows us to indicate the table fields wich contains the points X and Y coordinates. The default projection is the View, although it can be modified. Once the options are set we must click on the “Next” button.

  3. It allows us to indicate if we want to load the generated layer in one of the Views of the project. Once we click on the "Finish" button the new layer is created and, if appropriate, added to the selected View.

11.12. Add OGR layer

This tool adds OGR vector format files. The complete list of OGR files is available at http://www.gdal.org/ogr_formats.html

The steps to add an OGR file from the window Add Layer are the following:

  1. Go the tab “OGR”

  1. Select the button “...” to load a file

  2. Click the Button OPEN. It will add one or several rows (depending on the file format) to the list of available layers

  3. Select the layer to load

  4. Click ACCEPT and the layer will open on View

This Page