29 #include "../Defines.h" 30 #include "../core/filesystem/FileSystem.h" 31 #include "../core/logger/Logger.h" 32 #include "../core/plugin/CppPlugin.h" 33 #include "../core/translator/Translator.h" 34 #include "../core/utils/Platform.h" 35 #include "../dataaccess/datasource/DataSourceFactory.h" 36 #include "../dataaccess/datasource/DataSourceManager.h" 37 #include "../dataaccess/query/BinaryOpEncoder.h" 38 #include "../dataaccess/query/FunctionEncoder.h" 39 #include "../dataaccess/query/SQLDialect.h" 40 #include "../dataaccess/query/SQLFunctionEncoder.h" 41 #include "../dataaccess/query/TemplateEncoder.h" 42 #include "../dataaccess/query/UnaryOpEncoder.h" 48 #include <boost/filesystem.hpp> 69 std::string gdal_data_dir(TERRALIB_GDAL_DATA);
72 if(gdal_data_dir.empty() ||
77 #if defined(TE_PLATFORM) && defined(TE_PLATFORMCODE_MSWINDOWS) 78 #if TE_PLATFORM == TE_PLATFORMCODE_MSWINDOWS 80 #elif TE_PLATFORM == TE_PLATFORMCODE_APPLE 82 #elif TE_PLATFORM == TE_PLATFORMCODE_LINUX 85 #error "unsupported plataform: please, contact terralib-team@terralib.org" 89 "the macro TE_PLATFORM is not set, please, contact terralib-team@terralib.org" 93 if(!gdal_data_dir.empty())
95 CPLSetConfigOption(
"GDAL_DATA", gdal_data_dir.c_str());
98 CPLSetConfigOption(
"GDAL_DATA", gdal_data_dir.c_str());
100 CPLSetConfigOption(
"GDAL_PAM_ENABLED",
"NO");
112 #if GDAL_VERSION_NUM >= 1900 113 const char* currentValue = CPLGetConfigOption(
"GDAL_FIX_ESRI_WKT",
"");
114 if(strcmp(currentValue,
"") == 0)
115 CPLSetConfigOption(
"GDAL_FIX_ESRI_WKT",
"GEOGCS");
TERRALIB_CPP_PLUGIN_BEGIN(Plugin) TERRALIB_CPP_PLUGIN_STARTUP
TE_LOG_TRACE(TE_TR("TerraLib OGR driver shutdown!"))
#define OGR_DRIVER_IDENTIFIER
The OGR driver identifier string.
static bool isDirectory(const std::string &path)
Checks if a given path in UTF-8 is a directory.
#define TERRALIB_CPP_PLUGIN_END(plugin_class_name)
Utility functions for OGR support.
TEOGREXPORT boost::mutex & getStaticMutex()
Returns a reference to a static mutex initialized when this module is initialized.
TERRALIB_CPP_PLUGIN_SHUTDOWN
#define TE_TR(message)
It marks a string in order to get translated.
static void remove(const std::string &dsType)
it finalizes the GDAL factory support.
static DataSourceManager & getInstance()
It returns a reference to the singleton instance.
#define TERRALIB_CPP_PLUGIN_STARTUP
te::da::DataSource * Build(const te::core::URI &uri)
A class for data providers of OGR.
void OGRErrorHandler(CPLErr eErrClass, int errNo, const char *msg)
TECOREEXPORT std::string FindInTerraLibPath(const std::string &path)
Returns the path relative to a directory or file in the context of TerraLib.
static void add(const std::string &dsType, FactoryFnctType f)
static void setDialect(te::da::SQLDialect *dialect)
An static class with global definitions.