Exporting to TerraLib

The export of maps to TerraLIB was developed due to the fact that it has a completely different structure than SPRING. In this version we can export maps of every model that use vector representation, that is:

  • Thematic - points, lines e polygons associated to classes;
  • Cadastral - points, lines and polygons associated to objects;
  • Network - points and lines associated to objects;
  • Numeric - spot heights and contour lines.

All the IL's of the models above are considered objects in the TerraLIB format. This way we can make the following observations regarding the IL's of each model:

  • Thematic IL - points, lines and polygons will be objects and the class will be stored as an attribute of the object;
  • Cadastral IL - points, lines and polygons will be objects. In this case, we must select which object of the IL will be exported and which attribute will be the key for the identification of such object;
  • Network IL - points and lines will be objects. In this case we must select which object of the IL will be exported and which attribute will be the key for the identification of such object;
  • Numeric IL - spot heights and contour lines will be objects and the height will be stored as an attribute of the object.

While exporting any IL, the files XXX.geo (with geometry) and XXX.tab (attributes of the object) are created. The default file name is the name of the category, that can be modified by the time of the exportation.

See the generic example of a XXX.geo and a XXX.tab file. Described below we will use the following nomenclature:

    Thematic - first item, is not between any symbols
    DEM - second item, represented between parenthesis ( )
    Cadastral - third item, represented between braces { }
    Cadastral , type logradouros - represented between brackets [ ].



//Exporter to TerraLib
//
//ASCII file in the following formats:
//XXXX.geo - for thematic (for numeric)
// POLYGONS
// # children+1 Class Index { # children+1 Value of the selected attribute NULL }
// # points
// X Y
// ...
// # points of the child
// X Y
// ...
// ...
// ...
// END
// LINES
// Class Index # points of the line ( Height z # points of the line ) { Value of the selected Attribute | NULL # points of the line }
// X Y
// ...
// ...
// END
// POINTS
// Class Index ( Height z )
// X Y
// ...
// END


 
//XXXX.tab - for thematic (for numeric) {for Cadastral} [ for Cadastral - option logradouros ]
// TABLE
// THEMATIC CODE ( NUMERIC CODE ) { CADASTRAL Name of the selected attribute} [ TRECHOS ]
// SEPARATOR ,
// CODIGO,INTEGER,16,0 ( CODIGO,INTEGER,24,0 ) { ROTULO,TEXT,32,0 } [ COMPRIMENTO,REAL,16,6]
// CODIGO,TEXT,16,0
// LOGRADOURO,TEXT,8,0
// TRECHO,TEXT,8,0
// NOME,TEXT,64,0
// TIPO,TEXT,24,0
// TITULO,TEXT,16,0
// ETIQUETA,TEXT,80,0 ]
// CLASSE,TEXT,32,0 ( COTA,REAL,16,6 ) { NOME,TEXT,32,0 }
// { Defining category attributes - name,type,size}
// INFO_END
// Indice da Classe,Nome da Classe ( Cota Z,Cota Z ) { Valores dos registros }
//


Exporting IL's to TerraLib:

  • activate in the "Control Panel" the the Infolayer (of the category Thematic, Numeric, Cadastral, or Network) that contains the data for exportation;
  • click on File - Export to TerraLIB... . The window "Export Terralib" will be presented;
  • click on Coord.: and choose among Planes(meters), Geographic(degrees), Geographic(GMS) or Geographic(seconds) (degrees, minutes and seconds), only for the export to the format ASCII;
  • in the case of the Cadastral or Network IL's click on Category... and choose the category of the object used in the active IL;
  • in the list Object Attributes choose the attribute that identify the objects;
  • click on Execute;
  • in the window "Save As" choose the directory and the name of the file. Click on Save to perform the exportation.



See also:
How to IMPORT data ?
How to EXPORT data ?
About the ASCII-SPRING format for the interchange of geographic data.