Loading...
Searching...
No Matches
te::ogr Namespace Reference

Namespace for the OGR Driver Implementation of TerraLib. More...

Classes

class  DataSet
 Implementation of a DataSet for OGR data provider. More...
 
class  DataSource
 The OGR data source provider. More...
 
class  Globals
 An static class with global definitions. More...
 
class  SQLVisitor
 A visitor for building an SQL statement from a given Query hierarchy - OGR Driver. More...
 
class  Transactor
 

Functions

te::da::DataSourceBuild (const te::core::URI &uri)
 
TEOGREXPORT OGREnvelope * Convert2OGR (const te::gm::Envelope *env)
 It converts the TerraLib Envelope to OGR Envelope.
 
TEOGREXPORT OGRGeometry * Convert2OGR (const te::gm::Geometry *teGeom)
 It converts the TerraLib Geometry to OGR Geometry.
 
TEOGREXPORT OGRGeometry * Convert2OGR (const te::gm::Geometry *teGeom, OGRSpatialReference *srs)
 It converts the TerraLib Geometry to OGR Geometry.
 
TEOGREXPORT OGRFeatureDefn * Convert2OGR (te::da::DataSetType *dt)
 It converts the TerraLib DataSet Type to OGR Feature Definition.
 
TEOGREXPORT OGRFieldDefn * Convert2OGR (te::dt::Property *p)
 It converts the TerraLib Property Type to OGR Field Definition.
 
TEOGREXPORT OGRwkbGeometryType Convert2OGR (te::gm::GeomType geomType)
 It converts the TerraLib Geometry Type element to OGR Geometry Type.
 
TEOGREXPORT OGRGeomFieldDefn * Convert2OGRGeom (te::dt::Property *p)
 It converts the TerraLib Geometric Property Type to OGR Geometric Field Definition.
 
TEOGREXPORT OGRSpatialReference * Convert2OGRProjection (int srid)
 It converts the TerraLib Projection to OGR Projection.
 
TEOGREXPORT te::gm::EnvelopeConvert2TerraLib (const OGREnvelope *env)
 It converts the OGR Envelope to TerraLib Envelope.
 
TEOGREXPORT te::da::DataSetTypeConvert2TerraLib (OGRFeatureDefn *featDef, const std::string &geometryPropertyName, int srs=TE_UNKNOWN_SRS)
 It converts the OGR Feature Definition to TerraLib DataSet Type.
 
TEOGREXPORT void Convert2TerraLib (OGRFeatureDefn *featDef, te::da::DataSetType *dt, const std::string &geometryPropertyName, int srs=TE_UNKNOWN_SRS)
 It inserts a OGR Feature Definition to TerraLib DataSet Type.
 
TEOGREXPORT te::dt::PropertyConvert2TerraLib (OGRFieldDefn *fieldDef)
 It converts the OGR Field Definition to TerraLib Property Type.
 
TEOGREXPORT te::gm::GeometryConvert2TerraLib (OGRGeometry *ogrGeom)
 It converts the OGR Geometry to TerraLib Geometry.
 
TEOGREXPORT te::gm::GeomType Convert2TerraLib (OGRwkbGeometryType ogrGeomType)
 It converts the OGR Geometry Type element to TerraLib Geometry Type.
 
TEOGREXPORT int Convert2TerraLibProjection (const OGRSpatialReference &osrs)
 It converts the OGR Projection to TerraLib Projection.
 
TEOGREXPORT int Convert2TerraLibProjection (OGRSpatialReference *osrs)
 It converts the OGR Projection to TerraLib Projection.
 
TEOGREXPORT GDALDataset * CreateGDALDataSet (const std::string &pszFilename, unsigned int nOpenFlags)
 Creates a GDALDataSet based on the given fileName and open flags. The main purpose of this function is to ensure that known files with extensions will be open if the correct drivers.
 
TEOGREXPORT OGRLayer * ExecuteSQL (GDALDataset *gdalDataSet, const std::string &query)
 Executes the given query in the given dataSet. Throws exception in case of error. It also handles FID for specific drivers.
 
TEOGREXPORT te::da::DataSetTypeGetDataSetType (GDALDataset *gdalDataSet, OGRLayer *ogrLayer, int srs=TE_UNKNOWN_SRS)
 It converts the OGR Feature Definition to TerraLib DataSet Type. It also handles FID and Geometry property issues.
 
std::string GetDriverName (const std::string &path)
 It tries extract the driver name used by OGR Library based on the given path.
 
TEOGREXPORT std::string GetOGRConnectionInfo (const std::map< std::string, std::string > &connInfo)
 
TEOGREXPORT std::vector< std::string > GetOGRDrivers (bool filterCreate=false)
 It returns the list of OGR Drivers available.
 
TEOGREXPORT boost::mutex & getStaticMutex ()
 Returns a reference to a static mutex initialized when this module is initialized.
 
bool InitValidator (te::da::FieldNameValidator &validator, OGRFeatureDefn *ogrFeatureDefinition)
 
void OGRErrorHandler (CPLErr eErrClass, int errNo, const char *msg)
 
TEOGREXPORT std::string RemoveSpatialSql (const std::string &sql)
 

Detailed Description

Namespace for the OGR Driver Implementation of TerraLib.

Function Documentation

◆ Build()

te::da::DataSource * te::ogr::Build ( const te::core::URI & uri)

◆ Convert2OGR() [1/6]

TEOGREXPORT OGREnvelope * te::ogr::Convert2OGR ( const te::gm::Envelope * env)

It converts the TerraLib Envelope to OGR Envelope.

Parameters
envA valid TerraLib Envelope.
Returns
A valid OGR Envelope.
Note
The caller of this function will take the ownership of the returned OGR Envelope.

References TEOGREXPORT.

◆ Convert2OGR() [2/6]

TEOGREXPORT OGRGeometry * te::ogr::Convert2OGR ( const te::gm::Geometry * teGeom)

It converts the TerraLib Geometry to OGR Geometry.

Parameters
teGeomA valid TerraLib Geometry.
Returns
A valid TerraLib geometry.
Exceptions
ExceptionIt throws an exception if the TerraLib geometry can not be converted.
Note
It uses the WKB to create the TerraLib Geometry
The caller of this function will take the ownership of the returned OGR Geometry.

References TEOGREXPORT.

◆ Convert2OGR() [3/6]

TEOGREXPORT OGRGeometry * te::ogr::Convert2OGR ( const te::gm::Geometry * teGeom,
OGRSpatialReference * srs )

It converts the TerraLib Geometry to OGR Geometry.

Parameters
teGeomA valid TerraLib Geometry.
srsOGR srs information. It must not be const so it can be shared with the created geometry without the need of copying it.
Returns
A valid TerraLib geometry.
Exceptions
ExceptionIt throws an exception if the TerraLib geometry can not be converted.
Note
It uses the WKB to create the TerraLib Geometry
The caller of this function will take the ownership of the returned OGR Geometry.

References TEOGREXPORT.

◆ Convert2OGR() [4/6]

TEOGREXPORT OGRFeatureDefn * te::ogr::Convert2OGR ( te::da::DataSetType * dt)

It converts the TerraLib DataSet Type to OGR Feature Definition.

Parameters
dtA valid TerraLib DataSet Type.
Returns
A valid OGR Feature Definition.
Exceptions
ExceptionIt throws an exception if the data set type can not be converted.
Note
It uses the method that converts a TerraLib Property Type to OGR Field Definition.
The caller of this function will take the ownership of the returned OGR Feature Definition.

References TEOGREXPORT.

◆ Convert2OGR() [5/6]

TEOGREXPORT OGRFieldDefn * te::ogr::Convert2OGR ( te::dt::Property * p)

It converts the TerraLib Property Type to OGR Field Definition.

Parameters
ptA valid TerraLib Property Type.
Returns
A valid OGR Field Definition.
Exceptions
ExceptionIt throws an exception if the data type is not supported by OGR.

References TEOGREXPORT.

◆ Convert2OGR() [6/6]

TEOGREXPORT OGRwkbGeometryType te::ogr::Convert2OGR ( te::gm::GeomType geomType)

It converts the TerraLib Geometry Type element to OGR Geometry Type.

Parameters
geomTypeA valid TerraLib Geometry Type.
Returns
A valid OGR Geometry Type element
Exceptions
ExceptionIt throws an exception if the geometry type is not supported by OGR.

References TEOGREXPORT.

◆ Convert2OGRGeom()

TEOGREXPORT OGRGeomFieldDefn * te::ogr::Convert2OGRGeom ( te::dt::Property * p)

It converts the TerraLib Geometric Property Type to OGR Geometric Field Definition.

Parameters
ptA valid TerraLib Geometric Property Type.
Returns
A valid OGR Geometric Field Definition.
Exceptions
ExceptionIt throws an exception if the data type is not supported by OGR.

References TEOGREXPORT.

◆ Convert2OGRProjection()

TEOGREXPORT OGRSpatialReference * te::ogr::Convert2OGRProjection ( int srid)

It converts the TerraLib Projection to OGR Projection.

Parameters
sridA valid TerraLib Projection id.
Returns
A valid OGR Spatial Reference System.
Exceptions
ExceptionIt throws an exception if the SRS can not be imported using OGR.
Note
The caller of this function will take the ownership of the returned OGR Spatial Reference System.

References TEOGREXPORT.

◆ Convert2TerraLib() [1/6]

TEOGREXPORT te::gm::Envelope * te::ogr::Convert2TerraLib ( const OGREnvelope * env)

It converts the OGR Envelope to TerraLib Envelope.

Parameters
envA valid OGR Envelope.
Returns
A valid TerraLib Envelope.
Note
The caller of this function will take the ownership of the returned TerraLib Envelope.

References TEOGREXPORT.

◆ Convert2TerraLib() [2/6]

TEOGREXPORT te::da::DataSetType * te::ogr::Convert2TerraLib ( OGRFeatureDefn * featDef,
const std::string & geometryPropertyName,
int srs = TE_UNKNOWN_SRS )

It converts the OGR Feature Definition to TerraLib DataSet Type.

Parameters
featDefA valid OGR Feature Definition.
srsOptional parameter to set the SRS of geometry fields.
geometryPropertyNameA geomtry property name to force or an empty string to automatically find this value.
Returns
A valid TerraLib DataSet Type.
Exceptions
ExceptionIt throws an exception if the feature definition can not be converted.
Note
It uses the method that converts a OGR Field Definition to TerraLib Property Type.
It uses the method that converts a OGR Geometry Type to TerraLib Geometry Type.
The caller of this function will take the ownership of the returned TerraLib DataSet Type.

References TE_UNKNOWN_SRS, and TEOGREXPORT.

◆ Convert2TerraLib() [3/6]

TEOGREXPORT void te::ogr::Convert2TerraLib ( OGRFeatureDefn * featDef,
te::da::DataSetType * dt,
const std::string & geometryPropertyName,
int srs = TE_UNKNOWN_SRS )

It inserts a OGR Feature Definition to TerraLib DataSet Type.

Parameters
featDefA valid OGR Feature Definition.
dtPointer to a TerraLib dataset type previously created. Do not pass NULL.
srsOptional parameter to set the SRS of geometry fields.
geometryPropertyNameA geomtry property name to force or an empty string to automatically find this value.
Exceptions
ExceptionIt throws an exception if the feature definition can not be converted.
Note
It uses the method that converts a OGR Field Definition to TerraLib Property Type.
It uses the method that converts a OGR Geometry Type to TerraLib Geometry Type.

References TE_UNKNOWN_SRS, and TEOGREXPORT.

◆ Convert2TerraLib() [4/6]

TEOGREXPORT te::dt::Property * te::ogr::Convert2TerraLib ( OGRFieldDefn * fieldDef)

It converts the OGR Field Definition to TerraLib Property Type.

Parameters
fieldDefA valid OGR Field Definition.
Returns
A valid TerraLib Property Type.
Exceptions
ExceptionIt throws an exception if the data type is not supported by TerraLib.
Note
The caller of this function will take the ownership of the returned TerraLib Property Type.

References TEOGREXPORT.

◆ Convert2TerraLib() [5/6]

TEOGREXPORT te::gm::Geometry * te::ogr::Convert2TerraLib ( OGRGeometry * ogrGeom)

It converts the OGR Geometry to TerraLib Geometry.

Parameters
ogrGeomA valid OGR Geometry.
Returns
A valid TerraLib Geometry.
Exceptions
ExceptionIt throws an exception if the OGR geometry can not be converted.
Note
It uses the WKB to create the TerraLib Geometry
The caller of this function will take the ownership of the returned TerraLib Geometry.

References TEOGREXPORT.

◆ Convert2TerraLib() [6/6]

TEOGREXPORT te::gm::GeomType te::ogr::Convert2TerraLib ( OGRwkbGeometryType ogrGeomType)

It converts the OGR Geometry Type element to TerraLib Geometry Type.

Parameters
ogrGeomTypeA valid OGR Geometry Type element.
Returns
A valid TerraLib Geometry Type

References TEOGREXPORT.

◆ Convert2TerraLibProjection() [1/2]

TEOGREXPORT int te::ogr::Convert2TerraLibProjection ( const OGRSpatialReference & osrs)

It converts the OGR Projection to TerraLib Projection.

Parameters
osrsA valid OGR Projection.
Returns
An SRS id recognized by TerraLib or an indication of unknown SRS (TE_UNKNOWN_SRS)

References TEOGREXPORT.

◆ Convert2TerraLibProjection() [2/2]

TEOGREXPORT int te::ogr::Convert2TerraLibProjection ( OGRSpatialReference * osrs)

It converts the OGR Projection to TerraLib Projection.

Parameters
osrsA valid OGR Projection.
Returns
An SRS id recognized by TerraLib or an indication of unknown SRS (TE_UNKNOWN_SRS)

References TEOGREXPORT.

◆ CreateGDALDataSet()

TEOGREXPORT GDALDataset * te::ogr::CreateGDALDataSet ( const std::string & pszFilename,
unsigned int nOpenFlags )

Creates a GDALDataSet based on the given fileName and open flags. The main purpose of this function is to ensure that known files with extensions will be open if the correct drivers.

References TEOGREXPORT.

◆ ExecuteSQL()

TEOGREXPORT OGRLayer * te::ogr::ExecuteSQL ( GDALDataset * gdalDataSet,
const std::string & query )

Executes the given query in the given dataSet. Throws exception in case of error. It also handles FID for specific drivers.

Initialized the validator from the given layer definition

References TEOGREXPORT.

◆ GetDataSetType()

TEOGREXPORT te::da::DataSetType * te::ogr::GetDataSetType ( GDALDataset * gdalDataSet,
OGRLayer * ogrLayer,
int srs = TE_UNKNOWN_SRS )

It converts the OGR Feature Definition to TerraLib DataSet Type. It also handles FID and Geometry property issues.

Parameters
ogrLayerA valid OGR Layer.
srsOptional parameter to set the SRS of geometry fields.
Returns
A valid TerraLib DataSet Type.
Exceptions
ExceptionIt throws an exception if the feature definition can not be converted.
Note
It uses the method that converts a OGR Field Definition to TerraLib Property Type.
It uses the method that converts a OGR Geometry Type to TerraLib Geometry Type.
The caller of this function will take the ownership of the returned TerraLib DataSet Type.

References TE_UNKNOWN_SRS, and TEOGREXPORT.

◆ GetDriverName()

std::string te::ogr::GetDriverName ( const std::string & path)

It tries extract the driver name used by OGR Library based on the given path.

Parameters
pathThe path that will be consulted.
Returns
The driver name used by OGR Library or an empty string if not possible extract the driver name.

◆ GetOGRConnectionInfo()

TEOGREXPORT std::string te::ogr::GetOGRConnectionInfo ( const std::map< std::string, std::string > & connInfo)

References TEOGREXPORT.

◆ GetOGRDrivers()

TEOGREXPORT std::vector< std::string > te::ogr::GetOGRDrivers ( bool filterCreate = false)

It returns the list of OGR Drivers available.

Parameters
filterCreateSet TRUE to indicate to retrieve only the drivers with the capacity to create datasources.
Returns
A list of OGR Drivers.

References TEOGREXPORT.

◆ getStaticMutex()

TEOGREXPORT boost::mutex & te::ogr::getStaticMutex ( )

Returns a reference to a static mutex initialized when this module is initialized.

Returns
Returns a reference to a static mutex initialized when this module is initialized.

References TEOGREXPORT.

◆ InitValidator()

bool te::ogr::InitValidator ( te::da::FieldNameValidator & validator,
OGRFeatureDefn * ogrFeatureDefinition )

◆ OGRErrorHandler()

void te::ogr::OGRErrorHandler ( CPLErr eErrClass,
int errNo,
const char * msg )

◆ RemoveSpatialSql()

TEOGREXPORT std::string te::ogr::RemoveSpatialSql ( const std::string & sql)

References TEOGREXPORT.