A class that can parses a file with wkb encoded geometries. More...
#include <GeometryFile.h>
Public Member Functions | |
| te::gm::Geometry * | next () |
| Returns the next geometry. More... | |
| void | openFile (const char *fileName) throw (te::common::Exception) |
| Opens the file fileName. More... | |
| void | setGeometries (const std::vector< unsigned int > &gids) |
| Sets the desired geometries to get from file. More... | |
Initializer methods. | |
Methods for initializing and destructing object. | |
| GeometryFile () | |
| Constructor. More... | |
| ~GeometryFile () | |
| Destructor. More... | |
Static Public Member Functions | |
| static void | writeGeometries (const char *fileName, const std::map< int, te::gm::Geometry * > &geoms) |
| static void | writeGeometries (const char *fileName, const std::vector< te::gm::Geometry * > &geoms) |
Protected Attributes | |
| std::unique_ptr< std::ifstream > | m_file |
| Pointer to the geometry file. More... | |
| std::vector< unsigned int > | m_gids |
| Selected ids to use on traverse operation. More... | |
| unsigned int | m_i |
| Current position on traversing. More... | |
| std::unique_ptr< std::ifstream > | m_posFile |
| Pointer to the geometry pos file. More... | |
A class that can parses a file with wkb encoded geometries.
Definition at line 54 of file GeometryFile.h.
| GeometryFile::GeometryFile | ( | ) |
| GeometryFile::~GeometryFile | ( | ) |
| te::gm::Geometry * GeometryFile::next | ( | ) |
Returns the next geometry.
If the setGeometries was used, then the geometries to be returned are the geometries identified by ids given to the function, otherwise it will traverse the entire file.
Definition at line 51 of file GeometryFile.cpp.
References m_file, m_gids, m_i, m_posFile, and te::gm::WKBReader::read().
Referenced by GetStashedGeometries().
| void GeometryFile::openFile | ( | const char * | fileName | ) | |
| throw | ( | te::common::Exception | |||
| ) | |||||
Opens the file fileName.
| fileName | The name of geometry file. (File extension is .geom) |
| If | the file could not be opened an te::common::Exception will be raised. |
Definition at line 42 of file GeometryFile.cpp.
References m_file, and m_posFile.
Referenced by GetStashedGeometries().
| void GeometryFile::setGeometries | ( | const std::vector< unsigned int > & | gids | ) |
Sets the desired geometries to get from file.
This is a filter of the traversing file. If this is used before next was called, only geometries indentified by gids will be returned by next function. If not defined the file will be entirely traversed.
| gids | Ids of the geometries to be filtered. These values comes from 'FID' column. |
Definition at line 175 of file GeometryFile.cpp.
|
static |
Definition at line 92 of file GeometryFile.cpp.
Referenced by StashGeometries().
|
static |
Definition at line 133 of file GeometryFile.cpp.
|
protected |
Pointer to the geometry file.
Definition at line 115 of file GeometryFile.h.
Referenced by GeometryFile(), next(), openFile(), and ~GeometryFile().
|
protected |
Selected ids to use on traverse operation.
Definition at line 117 of file GeometryFile.h.
Referenced by next(), and setGeometries().
|
protected |
Current position on traversing.
Definition at line 118 of file GeometryFile.h.
Referenced by next(), and setGeometries().
|
protected |
Pointer to the geometry pos file.
Definition at line 116 of file GeometryFile.h.
Referenced by GeometryFile(), next(), openFile(), and ~GeometryFile().