Container class for geospatial vector data, represented by an OGR datasource.
More...
#include <core/GeoVectorValue.hpp>
|
| GeoVectorValue (std::string FilePath, std::string FileName) |
| Creates a new value. More...
|
|
| ~GeoVectorValue () |
| Closes the opened OGR datasource. More...
|
|
openfluid::core::UnstructuredValue::UnstructuredType | getType () const |
| Returns the type of this GeoVectorValue. More...
|
|
OGRDataSource * | get () |
| Gets the associated opened OGR datasource in read-only access. More...
|
|
OGRLayer * | getLayer (unsigned int LayerIndex=0) |
| Gets a layer of the shape. More...
|
|
OGRFeatureDefn * | getLayerDef (unsigned int LayerIndex=0) |
| Gets the Feature definition of a layer. More...
|
|
bool | isLineType (unsigned int LayerIndex=0) |
| Returns true if the GeoVectorValue is line type, false otherwise. More...
|
|
bool | isPolygonType (unsigned int LayerIndex=0) |
| Returns true if the GeoVectorValue is polygon type, false otherwise. More...
|
|
bool | containsField (std::string FieldName, unsigned int LayerIndex=0) |
| Returns true if a field exists in the LayerIndex layer. More...
|
|
int | getFieldIndex (std::string FieldName, unsigned int LayerIndex=0) |
| Gets the index of a field in the LayerIndex layer. More...
|
|
bool | isFieldOfType (std::string FieldName, OGRFieldType FieldType, unsigned int LayerIndex=0) |
| Returns true if a field is of the type FieldType in the LayerIndex layer. More...
|
|
bool | isPointType (unsigned int LayerIndex=0) |
| Returns true if the GeoVectorValue is point type, false otherwise. More...
|
|
bool | isMultiPolygonType (unsigned int LayerIndex=0) |
| Returns true if the GeoVectorValue is MultiPolygon type, false otherwise. More...
|
|
bool | isMultiLineType (unsigned int LayerIndex=0) |
| Returns true if the GeoVectorValue is MultiLine type, false otherwise. More...
|
|
bool | isMultiPointType (unsigned int LayerIndex=0) |
| Returns true if the GeoVectorValue is MultiPoint type, false otherwise. More...
|
|
| GeoValue (std::string FilePath, std::string FileName) |
|
virtual | ~GeoValue ()=0 |
|
std::string | getFilePath () |
|
| UnstructuredValue () |
|
virtual | ~UnstructuredValue () |
|
Container class for geospatial vector data, represented by an OGR datasource.
openfluid::core::GeoVectorValue::GeoVectorValue |
( |
std::string |
FilePath, |
|
|
std::string |
FileName |
|
) |
| |
Creates a new value.
For ESRI Shapefile, the FileName
may be the name of a .shp, .shx or .dbf file, or a path to a directory containing proper shape files.
It doesn't open the associated OGR datasource.
- Parameters
-
FilePath | The path of the file(s). |
FileName | The name or the relative path of the file to open. |
openfluid::core::GeoVectorValue::~GeoVectorValue |
( |
| ) |
|
Closes the opened OGR datasource.
bool openfluid::core::GeoVectorValue::containsField |
( |
std::string |
FieldName, |
|
|
unsigned int |
LayerIndex = 0 |
|
) |
| |
Returns true if a field exists in the LayerIndex layer.
- Parameters
-
FieldName | The name of the field to query. |
LayerIndex | The index of the layer to query, default 0. |
- Returns
- True if the field FieldName exists, False otherwise.
- Exceptions
-
openfluid::base::OFException | if OGR doesn't succeed to open the datasource. |
void openfluid::core::GeoVectorValue::destroyDataSource |
( |
| ) |
|
|
protected |
Destroy the OGRDataSource.
OGRDataSource* openfluid::core::GeoVectorValue::get |
( |
| ) |
|
Gets the associated opened OGR datasource in read-only access.
If the datasource is not already opened, tries to open it first.
- Returns
- The opened OGR datasource.
- Exceptions
-
openfluid::base::OFException | if OGR doesn't succeed to open the datasource. |
int openfluid::core::GeoVectorValue::getFieldIndex |
( |
std::string |
FieldName, |
|
|
unsigned int |
LayerIndex = 0 |
|
) |
| |
Gets the index of a field in the LayerIndex layer.
- Parameters
-
LayerIndex | The index of the layer to query, default 0. |
FieldName | The name of the field to query. |
- Returns
- The index of FieldName or -1 if field FieldName doesn't exist.
- Exceptions
-
openfluid::base::OFException | if OGR doesn't succeed to open the datasource. |
OGRLayer* openfluid::core::GeoVectorValue::getLayer |
( |
unsigned int |
LayerIndex = 0 | ) |
|
Gets a layer of the shape.
- Parameters
-
LayerIndex | The index of the asked layer, default 0. |
- Returns
- The layer indexed LayerIndex.
- Exceptions
-
openfluid::base::OFException | if OGR doesn't succeed to open the datasource. |
OGRFeatureDefn* openfluid::core::GeoVectorValue::getLayerDef |
( |
unsigned int |
LayerIndex = 0 | ) |
|
Gets the Feature definition of a layer.
- Parameters
-
LayerIndex | The index of the asked layer definition, default 0. |
- Returns
- The OGR Feature definition of the LayerIndex layer.
- Exceptions
-
openfluid::base::OFException | if OGR doesn't succeed to open the datasource. |
bool openfluid::core::GeoVectorValue::isFieldOfType |
( |
std::string |
FieldName, |
|
|
OGRFieldType |
FieldType, |
|
|
unsigned int |
LayerIndex = 0 |
|
) |
| |
Returns true if a field is of the type FieldType in the LayerIndex layer.
- Parameters
-
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. |
- Returns
- True if the field FieldName is type FieldType.
- Exceptions
-
openfluid::base::OFException | if the field doesn't exist. |
openfluid::base::OFException | if OGR doesn't succeed to open the datasource. |
bool openfluid::core::GeoVectorValue::isLineType |
( |
unsigned int |
LayerIndex = 0 | ) |
|
Returns true if the GeoVectorValue is line type, false otherwise.
- Parameters
-
LayerIndex | The index of the layer to compare the type, default 0. |
- Returns
- True if the type of the layer LayerIndex is wkbLineString, false otherwise.
- Exceptions
-
openfluid::base::OFException | if OGR doesn't succeed to open the datasource. |
bool openfluid::core::GeoVectorValue::isMultiLineType |
( |
unsigned int |
LayerIndex = 0 | ) |
|
Returns true if the GeoVectorValue is MultiLine type, false otherwise.
- Parameters
-
LayerIndex | The index of the layer to compare the type, default 0. |
- Returns
- True if the type of the layer LayerIndex is wkbMultiLineString, false otherwise.
- Exceptions
-
openfluid::base::OFException | if OGR doesn't succeed to open the datasource. |
bool openfluid::core::GeoVectorValue::isMultiPointType |
( |
unsigned int |
LayerIndex = 0 | ) |
|
Returns true if the GeoVectorValue is MultiPoint type, false otherwise.
- Parameters
-
LayerIndex | The index of the layer to compare the type, default 0. |
- Returns
- True if the type of the layer LayerIndex is wkbMultiPoint, false otherwise.
- Exceptions
-
openfluid::base::OFException | if OGR doesn't succeed to open the datasource. |
bool openfluid::core::GeoVectorValue::isMultiPolygonType |
( |
unsigned int |
LayerIndex = 0 | ) |
|
Returns true if the GeoVectorValue is MultiPolygon type, false otherwise.
- Parameters
-
LayerIndex | The index of the layer to compare the type, default 0. |
- Returns
- True if the type of the layer LayerIndex is wkbMultiPolygon, false otherwise.
- Exceptions
-
openfluid::base::OFException | if OGR doesn't succeed to open the datasource. |
bool openfluid::core::GeoVectorValue::isPointType |
( |
unsigned int |
LayerIndex = 0 | ) |
|
Returns true if the GeoVectorValue is point type, false otherwise.
- Parameters
-
LayerIndex | The index of the layer to compare the type, default 0. |
- Returns
- True if the type of the layer LayerIndex is wkbPoint, false otherwise.
- Exceptions
-
openfluid::base::OFException | if OGR doesn't succeed to open the datasource. |
bool openfluid::core::GeoVectorValue::isPolygonType |
( |
unsigned int |
LayerIndex = 0 | ) |
|
Returns true if the GeoVectorValue is polygon type, false otherwise.
- Parameters
-
LayerIndex | The index of the layer to compare the type, default 0. |
- Returns
- True if the type of the layer LayerIndex is wkbPolygon, false otherwise.
- Exceptions
-
openfluid::base::OFException | if OGR doesn't succeed to open the datasource. |
void openfluid::core::GeoVectorValue::tryToOpenSource |
( |
| ) |
|
|
protectedvirtual |
OGRDataSource* openfluid::core::GeoVectorValue::mp_Data |
|
protected |
The documentation for this class was generated from the following file: