TerraLib 4 Converter

TerraLib 4.x Converter is a tool used to convert data to TerraLib 5 model. It only supports TerraLib databases generated by TerraView 4.2.2. If the selected database is from a previous version, a warning message will appear.  In this case, firstly install TerraView 4.2.2 and then open the database to perform the conversion to 4.2.2, then try to use this tool again.

IMPORTANT NOTE:  If you have Microsoft Office 32-bit installed, you need to install the new database engine called ACE (AccessDataBaseEngine_x64), available for 64 bits,  in order to access the new Microsoft Access file extension *.accdb.

However, a previous version of the database engine is already installed together with Office 32-bit -  called Microsoft Jet database engine. To make both of them work together  there is a workaround  explained in "Using TerraView 5 with Microsoft Access Database Files".

If you have Microsoft OFFICE 2013 64-bit installed, everything  should  work without any installation.  

It is accessible through:

    Tools > TerraLib4 Converter... 

This tool follows a wizard standard in 7 steps to assist the conversion:

  1. Connect to a TerraLib4 Database (it is the same interface used to connect with a database in TerraLib4.x).
                 
    1. The operation will be always  Connect.
    2. Select the Database Type  (Access). It is only implemented for Access.
    3. Inform the connection parameters (Host, Port, User, Password) if the database type is not Access)
    4. Select the Database... on version 4.2.2
    5. Press Next
      1. If the warning message "The database must be converted to the model 4.2.2"  occur -  press OK
      2. Press Cancel.  
      3. Open this database under TerraView 4.2.2 to convert it to this version and them come back here.
  1. Layer Selection - Select the Layers that will be converted to TerraLib 5.
    1. Under Layers List  it is possible to Select All or Deselect All.
    2. Select All or at least one of them by checking the box. 
    3. Press Next.
  2. Target Data Source -  Select a data source to store the converted data.
    1. On the left, select one of the datasource manager: Microsoft Access, PostGis, Vector Filesm WFS, WCS) and:
      1. Select one of the Available Data Sources  from the list and press NEXT or
      2. Create a new datasource and press NEXT. See the details for PostGIS datasource below.
                              -  For PostGIS inform all parameters at PostGIS Creator interface and came back here.
                              -  Select from Available Data Sources the connection generated (ex: xxxx.dpi.inpe.br@my_db@postgres)  and
                              - Click on change icon to change Client Encoding from UTF8 to LATIN1 or CP1252, otherwise some tables with caracters like ç, ã will not be converted and a message will list those tables.  These tables can be converted afterwards,  connecting again and changing Client Encoding.
                              - HINT: Click over the Password to get access to the Client Encoding list and then choose to LATIN1 or CP1252.
                              - Click OPEN.
  1. Target Raster Folder - This step is necessary only when there is at least one raster layer to be converted.  Select a folder to store the raster layers as TIFF files.
    1. Click on folder icon to define where to store the raster layers as TIFF files.
    2. Press Next.
  2. Resolve/No Name Conflicts - Some layer name might crash with layer names in the target data source. For those marked with   it is necessary to change. The others can also have its names changed.
    1. Double-Click over the Target Name cell and enter the new name for all layers marked.
    2. Press Commit. After this step all layers are already available at the the target Data Source. 
  3. Layer Creation - Select which Terralib4.x layers converted will be part of your current project in TerraLib5.
    1. Select All or some of them by checking the box to create a corresponding layer at your project - and a default Style.
    2. If Deselect All is chosen, the layers can be added afterwards as they are available at the target datasource. 
    3. Press Next.
  4. Theme Creation - Select which Terralib4.x Themes of converted Layers will be a layer in your current project in Terralib5, with information like Visual and Grouping. Check the hint bellow before selection.
    1. Select All or some of them by checking the box.  
    2. If Deselect All is chosen, the Themes will not be represented  in your current project.
    3. Press Finish.
Hint: In TerraLib4.x the concept of Layer, View and Theme are used. The same Layer can be represented in different Views as Themes, and each View holds a specific Spatial Reference System (projection).  By default, all View/Themes  are selected to be converted, but it takes time and in most cases it is not necessary as there are tools to handle diferent projections.  However, if you want to keep information like Visual and Grouping represented in a  View, keep it checked.

In the table  below the layer named  "IBGE_Mun_55mu2500g" would generate three layers into your project (at the Layer Explorer Tree) as the two last lines were checked. One for each view/theme (RADAM_TREES_Ori and 0BRASIL) checked and one for the original layer selected at the step 6.  These may cause more than one layer with the same name in your Layer Explorer Tree.  Also if a layer from a view is selected,  the visual caracteristics (color) are used to define the style.


TerraView4.2.2 also allows you to keep more than one representation in one layer. For example, a layer containting polygons and its centroids. If such case occurs, the converter will consider only one representaton in this order: Polygons, Lines, Points.  Keep in mind that centroids can be easy generated.

Alternativily, use TerraView-4.2.2  to export Layers which  more than one representing before conversion. In this case, it will be generated one shapefile for each representation.  These shapefiles representing only one representation can be imported into TerraView-4.2.2 and them converted, or added  directed into your TerraView5.x.