
Interface for managing Vector Data format. More...
#include <landr/VectorDataset.hpp>
Public Types | |
| typedef std::list< std::pair < OGRFeature *, geos::geom::Geometry * > > | FeaturesList_t |
| A list of pair of OGRFeature and geos::geom::Geometry related to this VectorDataset entities. | |
Public Member Functions | |
| VectorDataset (const std::string &FileName) | |
| Creates a new empty OGRDatasource in the openfluid temp directory, with filename suffixes with timestamp. | |
| VectorDataset (openfluid::core::GeoVectorValue &Value) | |
| Creates in the openfluid temp directory a copy of Value OGRDatasource, using Value filename suffixed with timestamp as filename. | |
| VectorDataset (const VectorDataset &Other) | |
| Copy constructor. | |
| ~VectorDataset () | |
| Delete the OGRDatasource and relative files in openfluid temp directory. | |
| OGRDataSource * | getDataSource () |
| Returns the OGRDataSource associated to this VectorDataset. | |
| OGRDataSource * | getDataSource () const |
| Returns the const OGRDataSource associated to this VectorDataset. | |
| void | copyToDisk (const std::string &FilePath, const std::string &FileName, bool ReplaceIfExists) |
| Write to disk a copy of the OGRDataSource. | |
| void | addALayer (std::string LayerName="", OGRwkbGeometryType LayerType=wkbUnknown, OGRSpatialReference *SpatialRef=NULL) |
| Add to DataSource an empty new layer. | |
| OGRLayer * | getLayer (unsigned int LayerIndex=0) |
| Get a layer of the shape. | |
| OGRFeatureDefn * | getLayerDef (unsigned int LayerIndex=0) |
| Get the Feature definition of a layer. | |
| void | addAField (const std::string &FieldName, OGRFieldType FieldType=OFTString, unsigned int LayerIndex=0) |
| Add a field to a layer. | |
| bool | isLineType (unsigned int LayerIndex=0) |
| Returns true if the VectorDataset is line type. | |
| bool | isPolygonType (unsigned int LayerIndex=0) |
| Returns true if the VectorDataset is polygon type. | |
| bool | containsField (const std::string &FieldName, unsigned int LayerIndex=0) |
| Returns true if a field exists in the LayerIndex layer. | |
| int | getFieldIndex (const std::string &FieldName, unsigned int LayerIndex=0) |
| Get the index of a field in the LayerIndex layer. | |
| bool | isFieldOfType (const std::string &FieldName, OGRFieldType FieldType, unsigned int LayerIndex=0) |
| Returns true if a field is of the type FieldType in the LayerIndex layer. | |
| bool | isIntValueSet (const std::string &FieldName, int Value, unsigned int LayerIndex=0) |
| Returns true if a field has the value Value in the LayerIndex layer. | |
| FeaturesList_t | getFeatures (unsigned int LayerIndex=0) |
| Gets the list of all features of a layer of this GeoVectorValue. | |
| geos::geom::Geometry * | getGeometries (unsigned int LayerIndex=0) |
| Gets a geos::geom::Geometry representing a collection of all the geometries of the layer LayerIndex of this GeoVectorValue. | |
| bool | isPointType (unsigned int LayerIndex=0) |
| Returns true if the VectorDataset is point type. | |
Interface for managing Vector Data format.
| typedef std::list<std::pair<OGRFeature*, geos::geom::Geometry*> > openfluid::landr::VectorDataset::FeaturesList_t |
A list of pair of OGRFeature and geos::geom::Geometry related to this VectorDataset entities.
| openfluid::landr::VectorDataset::VectorDataset | ( | const std::string & | FileName | ) |
Creates a new empty OGRDatasource in the openfluid temp directory, with filename suffixes with timestamp.
| FileName | The name of the file to create. |
| openfluid::base::OFException | if fails. |
Creates in the openfluid temp directory a copy of Value OGRDatasource, using Value filename suffixed with timestamp as filename.
| Value | The GeoVectorValue to copy |
| openfluid::base::OFException | if fails. |
| openfluid::landr::VectorDataset::VectorDataset | ( | const VectorDataset & | Other | ) |
Copy constructor.
| openfluid::base::OFException | if fails. |
Delete the OGRDatasource and relative files in openfluid temp directory.
| void openfluid::landr::VectorDataset::addAField | ( | const std::string & | FieldName, |
| OGRFieldType | FieldType = OFTString, |
||
| unsigned int | LayerIndex = 0 |
||
| ) |
Add a field to a layer.
| FieldName | The name of the field to add. |
| FieldType | The type of the field to add (default OFTString). |
| LayerIndex | The index of the layer to add the field, default 0. |
| openfluid::base::OFException | if creating field failed. |
| void openfluid::landr::VectorDataset::addALayer | ( | std::string | LayerName = "", |
| OGRwkbGeometryType | LayerType = wkbUnknown, |
||
| OGRSpatialReference * | SpatialRef = NULL |
||
| ) |
Add to DataSource an empty new layer.
| LayerName | The name of the layer to create. |
| LayerType | The type of the layer to create, default wkbUnknown. |
| SpatialRef | The coordinate system to use for the new layer, or NULL (default) if no coordinate system is available. |
| openfluid::base::OFException | if the creation of layer failed. |
| bool openfluid::landr::VectorDataset::containsField | ( | const std::string & | FieldName, |
| unsigned int | LayerIndex = 0 |
||
| ) |
Returns true if a field exists in the LayerIndex layer.
| FieldName | The name of the field to query. |
| LayerIndex | The index of the layer to query, default 0. |
| void openfluid::landr::VectorDataset::copyToDisk | ( | const std::string & | FilePath, |
| const std::string & | FileName, | ||
| bool | ReplaceIfExists | ||
| ) |
Write to disk a copy of the OGRDataSource.
| FilePath | The path to the directory where writing, will be created if needed. |
| FileName | The name of the file to write. |
| ReplaceIfExists | If true and the file FilePath/FileName already exists, overwrite it. |
| OGRDataSource* openfluid::landr::VectorDataset::getDataSource | ( | ) |
Returns the OGRDataSource associated to this VectorDataset.
| OGRDataSource* openfluid::landr::VectorDataset::getDataSource | ( | ) | const |
Returns the const OGRDataSource associated to this VectorDataset.
| FeaturesList_t openfluid::landr::VectorDataset::getFeatures | ( | unsigned int | LayerIndex = 0 | ) |
Gets the list of all features of a layer of this GeoVectorValue.
| LayerIndex | The index of the layer to query, default 0. |
| int openfluid::landr::VectorDataset::getFieldIndex | ( | const std::string & | FieldName, |
| unsigned int | LayerIndex = 0 |
||
| ) |
Get the index of a field in the LayerIndex layer.
| LayerIndex | The index of the layer to query, default 0. |
| FieldName | The name of the field to query. |
| geos::geom::Geometry* openfluid::landr::VectorDataset::getGeometries | ( | unsigned int | LayerIndex = 0 | ) |
Gets a geos::geom::Geometry representing a collection of all the geometries of the layer LayerIndex of this GeoVectorValue.
| LayerIndex | The index of the layer to query, default 0. |
| OGRLayer* openfluid::landr::VectorDataset::getLayer | ( | unsigned int | LayerIndex = 0 | ) |
Get a layer of the shape.
| LayerIndex | The index of the asked layer, default 0. |
| OGRFeatureDefn* openfluid::landr::VectorDataset::getLayerDef | ( | unsigned int | LayerIndex = 0 | ) |
Get the Feature definition of a layer.
| LayerIndex | The index of the asked layer definition, default 0. |
| bool openfluid::landr::VectorDataset::isFieldOfType | ( | const std::string & | FieldName, |
| OGRFieldType | FieldType, | ||
| unsigned int | LayerIndex = 0 |
||
| ) |
Returns true if a field is of the type FieldType in the LayerIndex layer.
| FieldName | The name of the field to query. |
| FieldType | The type of the field to query. |
| LayerIndex | The index of the layer to query, default 0. |
| openfluid::base::OFException | if the field doesn't exist. |
| bool openfluid::landr::VectorDataset::isIntValueSet | ( | const std::string & | FieldName, |
| int | Value, | ||
| unsigned int | LayerIndex = 0 |
||
| ) |
Returns true if a field has the value Value in the LayerIndex layer.
| FieldName | The name of the field to query. |
| Value | The value to query. |
| LayerIndex | The index of the layer to query, default 0. |
| bool openfluid::landr::VectorDataset::isLineType | ( | unsigned int | LayerIndex = 0 | ) |
Returns true if the VectorDataset is line type.
| LayerIndex | The index of the layer to compare the type, default 0. |
| bool openfluid::landr::VectorDataset::isPointType | ( | unsigned int | LayerIndex = 0 | ) |
Returns true if the VectorDataset is point type.
| LayerIndex | The index of the layer to compare the type, default 0. |
| bool openfluid::landr::VectorDataset::isPolygonType | ( | unsigned int | LayerIndex = 0 | ) |
Returns true if the VectorDataset is polygon type.
| LayerIndex | The index of the layer to compare the type, default 0. |
1.7.6.1