| TerraLib 4.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Examples

Functions
format
Geographical data formats

## Functions

TLFUNCTIONS_DLL bool | TeImportCSVFile (const string &csvFileName, TeTable &attrTable, TeDatabase *db, TeLayer *layer=0, const char &separator=',', const bool &firstLineIsHeader=false, const unsigned int &chunkSize=100, const bool &createAutoNum=false)
TLFUNCTIONS_DLL bool | TeImportCSVFile (const string &csvFileName, const int &attributeX, const int &attributeY, TeTable &attrTable, TeDatabase *db, TeLayer *layer, const char &separator=',', const bool &firstLineIsHeader=false, const unsigned int &chunkSize=100, const bool &createAutoNum=false)
TLFUNCTIONS_DLL bool | TeExportQuerierToCSV (TeQuerier *querier, const std::string &filename, const char &sep=';')
TLFUNCTIONS_DLL bool | TeExportLayerToCSV (TeLayer *layer, const string &filename="", const char &sep=';')
TLFUNCTIONS_DLL bool | TeExportThemeToCSV (TeTheme *theme, TeSelectedObjects selOb, const std::string &filename="", const char &sep=';')

## Detailed Description

Functions related to CSV format

## Function Documentation

TLFUNCTIONS_DLL bool TeExportLayerToCSV | ( | TeLayer * | layer,
|  | const string & | filename = `""`,
|  | const char & | sep = `';'`
| ) |  |

Exports a layer in a TerraLib database to a file in ASCII CSV format This function can be used only when the layers contains POINT representation. First line contains the name of the attributes.

Parameters:

  layer | pointer to the layer
  filename | name of the output MID/MIF file
  sep | separator to be used

Returns:
  TRUE if the data was successfully exported and FALSE otherwise

TLFUNCTIONS_DLL bool TeExportQuerierToCSV | ( | TeQuerier * | querier,
|  | const std::string & | filename,
|  | const char & | sep = `';'`
| ) |  |

Exports a querier to a Comma-Separated Values data file

Parameters:

  querier | pointer to a valid querier
  filename | name of the output CSV file
  sep | separator to be used

Returns:
  TRUE if the data was successfully exported and FALSE otherwise This function can be used only when the querier access point representation data. First line contains the name of the attributes.

TLFUNCTIONS_DLL bool TeExportThemeToCSV | ( | TeTheme * | theme,
|  | TeSelectedObjects | selOb,
|  | const std::string & | filename = `""`,
|  | const char & | sep = `';'`
| ) |  |

Exports a theme in a TerraLib database to a file in ASCII CSV format This function can be used only when the theme acontains POINT representation. First line contains the name of the attributes.

Parameters:

  theme | pointer to the theme
  filename | name of the output MID/MIF file
  selOb | selection of the objects that should be exported
  sep | separator to be used

Returns:
  TRUE if the data was successfully exported and FALSE otherwise

TLFUNCTIONS_DLL bool TeImportCSVFile | ( | const string & | csvFileName,
|  | TeTable & | attrTable,
|  | TeDatabase * | db,
|  | TeLayer * | layer = `0`,
|  | const char & | separator = `','`,
|  | const bool & | firstLineIsHeader = `false`,
|  | const unsigned int & | chunkSize = `100`,
|  | const bool & | createAutoNum = `false`
| ) |  |

Creates an attribute table in a TerraLib database and imports a CSV file to this table

Parameters:

  csvFileName | CSV file name
  attrTable | attribute table specifications
  db | pointer to a TerraLib database
  layer | pointer to a layer to which the table will associated
  separator | character used to separate the data in the CSV file
  firstLineIsHeader | indicates if the first line is a header
  chunkSize | number of objects in memory before save them in the database
  createAutoNum | indicates if the table first attribute is an autonumber which must be generated

Returns:
  TRUE if the data was imported successfully and FALSE otherwise

TLFUNCTIONS_DLL bool TeImportCSVFile | ( | const string & | csvFileName,
|  | const int & | attributeX,
|  | const int & | attributeY,
|  | TeTable & | attrTable,
|  | TeDatabase * | db,
|  | TeLayer * | layer,
|  | const char & | separator = `','`,
|  | const bool & | firstLineIsHeader = `false`,
|  | const unsigned int & | chunkSize = `100`,
|  | const bool & | createAutoNum = `false`
| ) |  |

Imports a CSV file to a layer in a TerraLib database, its geometries (points) and attributes

Parameters:

  csvFileName | CSV file name pointer to a layer
  attributeX | attribute index which provides the coordinate X
  attributeY | attribute index which provides the coordinate Y
  attrTable | attribute table specifications
  db | pointer to a TerraLib database
  layer | pointer to an empty layer which will be filled from CSV file
  separator | character used to separate the data in the CSV file
  firstLineIsHeader | indicates if the first line is a header
  chunkSize | number of objects in memory before save them in the database
  createAutoNum | indicates if the table first attribute is an autonumber which must be generated

Returns:
  TRUE if the data was imported successfully and FALSE otherwise

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines