TerraLib 4.1
Shapefile format

Modules

 decode

Functions

SHP_DLL bool TeGetSHPInfo (std::string shpfileName, unsigned int &nShapes, TeBox &box, TeGeomRep &rep)
SHP_DLL TeLayerTeImportShape (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:
layerpointer to the layer
baseNamename 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:
psthe polygon set
base_file_namethe 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:
querierpointer to a valid querier
baseNamename 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:
themepointer to the layer
selObthe objetct selection: TeALL, TePOINTED, TeQUERIED...
baseNamename of the output shapefile. If empty, the file will have the same name as the Theme.
attributeslist 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:
shpFileNameShapefile name
nShapesto return the number of shapes in the shapefile
boxto return the boundary box of the shapes contained in the shapefile
repto 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:
shpFileNameShapefile name
dbpointer to a TerraLib database
layerNamename 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:
layerpointer to a layer
shpFileNameshapefile file name
attrTableNamethe name that the attribute table will be saved
objectIdAttrname of the attribute that has the identification of objects
chunkSizethe 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:
stosetthe STOSet that will be filled
fileNameshape file name
SHP_DLL void TeWriteDataProjectionToFile ( TeProjection projection,
const std::string fileName 
)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines