| TerraLib 4.1

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

Modules | Functions
Shapefile format
Geographical data formats

## Modules

| decode

## Functions

SHP_DLL bool | TeGetSHPInfo (std::string shpfileName, unsigned int &nShapes, TeBox &box, TeGeomRep &rep)
SHP_DLL TeLayer * | TeImportShape (const string &shpFileName, TeDatabase *db, const string &layerName="")
SHP_DLL bool | TeImportShape (TeLayer *layer, const string &shpFileName, string attrTableName="", string objectIdAttr="", unsigned int chunkSize=60, const bool &useTransaction=true)
SHP_DLL bool | TeExportQuerierToShapefile (TeQuerier *querier, const std::string &baseName)
SHP_DLL bool | TeExportThemeToShapefile (TeTheme *theme, TeSelectedObjects selOb=TeAll, const std::string &baseName="", const std::vector< std::string > attributes=std::vector< std::string >())
SHP_DLL bool | TeExportLayerToShapefile (TeLayer *layer, const string &baseName="")
SHP_DLL bool | TeExportShapefile (TeLayer *layer, const string &shpFileName, const string &tableName, const string &restriction="")
SHP_DLL bool | TeExportPolygonSet2SHP (const TePolygonSet &ps, const string &base_file_name)
SHP_DLL bool | TeSTOSetBuildSHP (TeSTElementSet &stoset, const string &fileName)
| Builds the spatial object set from database according to the restrictions previously defined.
SHP_DLL DBFHandle | TeCreateDBFFile (const string &dbfFilename, TeAttributeList &attList)
SHP_DLL void | TeWriteDataProjectionToFile (TeProjection *projection, const std::string &fileName)

## Detailed Description

Functions related to Shapefile format. Uses some functions related to DBF attribute table format.

## Function Documentation

SHP_DLL DBFHandle TeCreateDBFFile | ( | const string & | dbfFilename,
|  | TeAttributeList & | attList
| ) |  |

SHP_DLL bool TeExportLayerToShapefile | ( | TeLayer * | layer,
|  | const string & | baseName = `""`
| ) |  |

Exports a layer in a TerraLib database to a shapefile

Parameters:

  layer | pointer to the layer
  baseName | name of the output shapefile. If empty, the file will have the same name as the Layer.

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

SHP_DLL bool TeExportPolygonSet2SHP | ( | const TePolygonSet & | ps,
|  | const string & | base_file_name
| ) |  |

Exports a TerraLib polygon set to a shapefile Each polygon will be a shape. Only one attribute will be created: the object id of the polygon.

Parameters:

  ps | the polygon set
  base_file_name | the base file name used to build the shapefile

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

SHP_DLL bool TeExportQuerierToShapefile | ( | TeQuerier * | querier,
|  | const std::string & | baseName
| ) |  |

Exports a querier to a shapefile

Parameters:

  querier | pointer to a valid querier
  baseName | name of the output shapefile

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

SHP_DLL bool TeExportShapefile | ( | TeLayer * | layer,
|  | const string & | shpFileName,
|  | const string & | tableName,
|  | const string & | restriction = `""`
| ) |  |

Exports a layer in a TerraLib database to a file in MID/MIF format

Deprecated:
  This is an overloaded function, provided for compatibility. It behaves essentially like the above function.

SHP_DLL bool TeExportThemeToShapefile | ( | TeTheme * | theme,
|  | TeSelectedObjects | selOb = `TeAll`,
|  | const std::string & | baseName = `""`,
|  | const std::vector< std::string > | attributes = `std::vector< std::string >()`
| ) |  |

Exports a theme in a TerraLib database to a shapefile

Parameters:

  theme | pointer to the layer
  selOb | the objetct selection: TeALL, TePOINTED, TeQUERIED...
  baseName | name of the output shapefile. If empty, the file will have the same name as the Theme.
  attributes | list of attributes to be exported. If empty, the file will have all the attributes.

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

SHP_DLL bool TeGetSHPInfo | ( | std::string | shpfileName,
|  | unsigned int & | nShapes,
|  | TeBox & | box,
|  | TeGeomRep & | rep
| ) |  |

Get the metadata information of a shapefile

Parameters:

  shpFileName | Shapefile name
  nShapes | to return the number of shapes in the shapefile
  box | to return the boundary box of the shapes contained in the shapefile
  rep | to return the type of geometry exist in the shapefile

Returns:
  true if succeeds and and false otherwise

SHP_DLL TeLayer* TeImportShape | ( | const string & | shpFileName,
|  | TeDatabase * | db,
|  | const string & | layerName = `""`
| ) |  |

Imports a geo data in a shapefile format to a TerraLib database

Parameters:

  shpFileName | Shapefile name
  db | pointer to a TerraLib database
  layerName | name of the layer that will contain the data (optional)

Returns:
  a pointer to created layer if the data was imported successfully and 0 otherwise

SHP_DLL bool TeImportShape | ( | TeLayer * | layer,
|  | const string & | shpFileName,
|  | string | attrTableName = `""`,
|  | string | objectIdAttr = `""`,
|  | unsigned int | chunkSize = `60`,
|  | const bool & | useTransaction = `true`
| ) |  |

Imports a shapefile to a layer TerraLib

Parameters:

  layer | pointer to a layer
  shpFileName | shapefile file name
  attrTableName | the name that the attribute table will be saved
  objectIdAttr | name of the attribute that has the identification of objects
  chunkSize | the number of objects in memory before save them in the layer

SHP_DLL bool TeSTOSetBuildSHP | ( | TeSTElementSet & | stoset,
|  | const string & | fileName
| ) |  |

Builds the spatial object set from database according to the restrictions previously defined.

Parameters:

  stoset | the STOSet that will be filled
  fileName | shape file name

SHP_DLL void TeWriteDataProjectionToFile | ( | TeProjection * | projection,
|  | const std::string & | fileName
| ) |  |

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines