### TerraLib 4.x 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 open the database to perform the initial conversion.

It is accessible through:

Tools > TerraLib4Converter...

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

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 or SQL Server)
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.

2. 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 on of them by checking the box.
3. Press Next.

3. Target Data Source - Select a data source to store the converted data (Data Source Selector).

1. Select one of the Available Data Sources from the list (or create a new one).
2. Press Next.

4. 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 to define where to store the raster layers as TIFF files.
2. Press Next.

5. 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.

6. 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.
2. If Deselect All is chosen, the layers can be added afterwards as they are available at the target datasource.
3. Press Next.

7. 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 of them are selected, but it takes time and in most cases it is not necessary as there are tools to handle the SRS.
In the table, the same input layer "IBGE_Mun_55mu2500g" would generate three layers in your current project if the two last lines were checked, one for each view and one for the original layer selected at the step 6. Usually the theme name is used to name the resulting layer avoiding conflict with the original layer.