Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
openfluid::core::GeoVectorValue Class Reference

#include <core/GeoVectorValue.hpp>

Inheritance diagram for openfluid::core::GeoVectorValue:
Inheritance graph
[legend]
Collaboration diagram for openfluid::core::GeoVectorValue:
Collaboration graph
[legend]

Public Member Functions

 GeoVectorValue (const std::string &FilePath, const std::string &FileName)
 
 ~GeoVectorValue ()
 
openfluid::core::UnstructuredValue::UnstructuredType getType () const
 
GDALDataset_COMPATdata ()
 
OGRLayer * layer (unsigned int LayerIndex=0)
 
OGRFeatureDefn * layerDef (unsigned int LayerIndex=0)
 
bool isLineType (unsigned int LayerIndex=0)
 
bool isPolygonType (unsigned int LayerIndex=0)
 
bool containsField (const std::string &FieldName, unsigned int LayerIndex=0)
 
int getFieldIndex (const std::string &FieldName, unsigned int LayerIndex=0)
 
bool isFieldOfType (const std::string &FieldName, OGRFieldType FieldType, unsigned int LayerIndex=0)
 
bool isPointType (unsigned int LayerIndex=0)
 
bool isMultiPolygonType (unsigned int LayerIndex=0)
 
bool isMultiLineType (unsigned int LayerIndex=0)
 
bool isMultiPointType (unsigned int LayerIndex=0)
 
- Public Member Functions inherited from openfluid::core::GeoValue
 GeoValue (const std::string &FilePath, const std::string &FileName)
 
virtual ~GeoValue ()=0
 
std::string getFilePath ()
 
- Public Member Functions inherited from openfluid::core::UnstructuredValue
 UnstructuredValue ()
 
virtual ~UnstructuredValue ()
 

Protected Member Functions

void tryToOpenSource ()
 
void destroyDataSource ()
 

Protected Attributes

GDALDataset_COMPATmp_Data
 
- Protected Attributes inherited from openfluid::core::GeoValue
std::string m_FilePath
 
std::string m_FileName
 
std::string m_AbsolutePath
 

Additional Inherited Members

- Public Types inherited from openfluid::core::UnstructuredValue
enum  UnstructuredType { GeoVectorValue, GeoRasterValue }
 
- Static Public Member Functions inherited from openfluid::core::GeoValue
static std::string computeAbsolutePath (const std::string &FilePath, const std::string &FileName)
 
- Static Public Member Functions inherited from openfluid::core::UnstructuredValue
static bool getValueTypeFromString (const std::string &ValueTypeString, UnstructuredValue::UnstructuredType &ValueType)
 
static std::string getStringFromValueType (const UnstructuredValue::UnstructuredType ValueType)
 

Constructor & Destructor Documentation

openfluid::core::GeoVectorValue::GeoVectorValue ( const std::string &  FilePath,
const 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
[in]FilePathThe path of the file(s).
[in]FileNameThe name or the relative path of the file to open.
openfluid::core::GeoVectorValue::~GeoVectorValue ( )

Destructor. Closes the open OGR datasource.

Member Function Documentation

bool openfluid::core::GeoVectorValue::containsField ( const std::string &  FieldName,
unsigned int  LayerIndex = 0 
)

Returns true if a field exists in the LayerIndex layer.

Parameters
[in]FieldNameThe name of the field to query.
[in]LayerIndexThe index of the layer to query, default 0.
Returns
True if the field FieldName exists, False otherwise.
Exceptions
openfluid::base::FrameworkExceptionif OGR doesn't succeed to open the datasource.
GDALDataset_COMPAT* openfluid::core::GeoVectorValue::data ( )

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::FrameworkExceptionif OGR doesn't succeed to open the datasource.
void openfluid::core::GeoVectorValue::destroyDataSource ( )
protected

Destroy the OGRDataSource.

int openfluid::core::GeoVectorValue::getFieldIndex ( const std::string &  FieldName,
unsigned int  LayerIndex = 0 
)

Gets the index of a field in the LayerIndex layer.

Parameters
[in]LayerIndexThe index of the layer to query, default 0.
[in]FieldNameThe name of the field to query.
Returns
The index of FieldName or -1 if field FieldName doesn't exist.
Exceptions
openfluid::base::FrameworkExceptionif OGR doesn't succeed to open the datasource.
openfluid::core::UnstructuredValue::UnstructuredType openfluid::core::GeoVectorValue::getType ( ) const
virtual

Returns the type of this GeoVectorValue.

Implements openfluid::core::UnstructuredValue.

bool openfluid::core::GeoVectorValue::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.

Parameters
[in]FieldNameThe name of the field to query.
[in]FieldTypeThe type of the field to query.
[in]LayerIndexThe index of the layer to query, default 0.
Returns
True if the field FieldName is type FieldType.
Exceptions
openfluid::base::FrameworkExceptionif the field doesn't exist.
openfluid::base::FrameworkExceptionif 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
[in]LayerIndexThe 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::FrameworkExceptionif 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
[in]LayerIndexThe 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::FrameworkExceptionif 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
[in]LayerIndexThe 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::FrameworkExceptionif 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
[in]LayerIndexThe 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::FrameworkExceptionif 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
[in]LayerIndexThe 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::FrameworkExceptionif 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
[in]LayerIndexThe 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::FrameworkExceptionif OGR doesn't succeed to open the datasource.
OGRLayer* openfluid::core::GeoVectorValue::layer ( unsigned int  LayerIndex = 0)

Gets a layer of the shape.

Parameters
[in]LayerIndexThe index of the asked layer, default 0.
Returns
The layer indexed LayerIndex.
Exceptions
openfluid::base::FrameworkExceptionif OGR doesn't succeed to open the datasource.
OGRFeatureDefn* openfluid::core::GeoVectorValue::layerDef ( unsigned int  LayerIndex = 0)

Gets the Feature definition of a layer.

Parameters
[in]LayerIndexThe index of the asked layer definition, default 0.
Returns
The OGR Feature definition of the LayerIndex layer.
Exceptions
openfluid::base::FrameworkExceptionif OGR doesn't succeed to open the datasource.
void openfluid::core::GeoVectorValue::tryToOpenSource ( )
protectedvirtual

Open the data source of this GeoVectorValue.

Exceptions
openfluid::base::FrameworkExceptionif OGR doesn't succeed to open the datasource.

Implements openfluid::core::GeoValue.

Member Data Documentation

GDALDataset_COMPAT* openfluid::core::GeoVectorValue::mp_Data
protected

The vector data source associated to this GeoVectorValue.


The documentation for this class was generated from the following file: