Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

Due to some specific terms and conditions the Countries spatial dataset cannot be distributed together with the application. In order to use Union VMS you will need to process and import this dataset manually. This section describes in detail this procedure.

Union VMS strictly requires a Countries spatial dataset in its spatial database. Without this dataset the system will not work as expected.


1. Donwloading the Countries spatial dataset

The recommended Countries spatial dataset to use within the Union VMS application can be downloaded at the Eurostat website. You should download two specific datasets as described in the following table.

Administrative or Statistical UnitScaleFormatFile name
Countries 20141:3 millionShapefile

CNTR_2014_03M_SH.zip

1:20 millionShapefileCNTR_2014_20M_SH.zip

The use of these datasets requires that you agree with some terms and conditions. Please read them carefully.


2. Importing the shapefiles into Union VMS spatial database

We recommend the use of QGIS (an open source Desktop GIS) to import these files into the Union VMS spatial database. The following instructions will assume that you have downloaded and installed QGIS (available here) in your system.

2.1 Importing shapefiles into QGIS

  • Unzip the file named CNTR_2014_03M_SH.zip
  • Open QGIS
  • Press the "Add vector layer" button () and then the browse button

          

  • Select the CNTR_RG_03M_2014.shp file and press the button "Open". You should now see a map of the world similar to the following:

         

2.2. Configuring Union VMS spatial database in QGIS

  • Click the "Add PostGIS layers" button () and then in the "New" button inside the "Connections" section and fill in all the fields with your current Union VMS settings. You can press the button "Test connect" to validate your definitions.

    Field nameDescriptionExample Value
    NameThe name to be used as an alias for the connection parametersunion-vms
    HostThe IP address or hostname of the server where the Union VMS database is deployedlocalhost
    PortThe Union VMS database server port5432 (if you have used doker installation this will be 25432)
    DatabaseThe Union VMS database namedb71u
    UsernameThe name of the user for the database connectionpostgres
    PasswordThe password for the specified user

         

  • Once you've finished, press the "Ok" button and then the "Close" button


2.3. Importing the shapefiles into the database

  • In the top menu, click in "Plugins" and then in "Manage and install plugins". Check that the "DB Manager" plugin is installed and activated. If not, install it and activate it. Press the button "Close".

         

  • Click on the "DB manager" plugin button (). On the left panel, expand the "PostGIS" node and should see the connection node you have created in the previous step (in this case called union-vms). Expand that node and you should see all the schemas that are used within the Union VMS application (e.g. spatial, rules, mdr, asset, ...).

          

  • To start importing the shapefile into the spatial database press the "Import layer/file" button (). In the new window, do the following configurations

    Field nameValue
    InputCNTR_RG_03M_2014
    Schemaspatial
    Tablectr_3m
    Primary keygid
    Geometry columngeom
    Source SRID4258
    Target SRID4326
    EncodingUTF-8

    Be sure to check the option "Create sptatial index".

         

  • Press the "OK" button to start importing the shapefile into your database. When finished you should be able to see your new layer listed under the spatial schema.
  • Repeat the previous steps for the other zip file (CNTR_2014_20M_SH.zip) you have downloaded changing your configurarions according to the following:

    Field nameValue
    InputCNTR_RG_20M_2014
    Schemaspatial
    Tablectr_20m
    Primary keygid
    Geometry columngeom
    Source SRID4258
    Target SRID4326
    EncodingUTF-8

2.4. Importing additional Countries metadata into the database

Within the datasets that you have downloaded there is a DBF file (CNTR_AT_2014.dbf) that contains additional metadata that is important to have within Union VMS. The next steps are describing how this file can be imported into the database.

  • Open QGIS
  • Press the "Add vector layer" button () , select UTF-8 as the encoding option.and press the "Browse" button.
  • In the new window, navigate to the folder where you have unzipped the files and select the CNTR_AT_2014.dbf file and press the "Open" button. If you don't see it listed, be sure that the option "All files" is selected.

          

  • You should now see a table listed in the left panel of QGIS.
  • Click on the "DB manager" plugin button (). On the left panel, expand the "PostGIS" node and should see the connection node you have created before (in this case called union-vms). Expand that node and you should see all the schemas that are used within the Union VMS application.
  • To start importing the DBF into the spatial database press the "Import layer/file" button (). In the new window, do the following configurations
    Field nameValue
    InputCNTR_AT_2014
    Schemaspatial
    Tablectr_metadata
  • Press the "OK" button to start importing the shapefile into your database. When finished you should be able to see your new layer listed under the spatial schema.


3. Prepare the data to be used within Union VMS




  • No labels