diff --git a/include/mapnik/datasource_cache.hpp b/include/mapnik/datasource_cache.hpp index 8ac3ecfbc..55b44343a 100644 --- a/include/mapnik/datasource_cache.hpp +++ b/include/mapnik/datasource_cache.hpp @@ -48,8 +48,10 @@ private: static std::map > plugins_; static bool registered_; static bool insert(const std::string& name,const lt_dlhandle module); + static std::vector plugin_directories_; public: - static std::vector plugin_names (); + static std::vector plugin_names(); + static std::string plugin_directories(); static void register_datasources(const std::string& path); static boost::shared_ptr create(parameters const& params); }; diff --git a/src/datasource_cache.cpp b/src/datasource_cache.cpp index 34dfb0d49..a1dbd6524 100644 --- a/src/datasource_cache.cpp +++ b/src/datasource_cache.cpp @@ -61,6 +61,7 @@ datasource_cache::~datasource_cache() std::map > datasource_cache::plugins_; bool datasource_cache::registered_=false; +std::vector datasource_cache::plugin_directories_; datasource_ptr datasource_cache::create(const parameters& params) { @@ -76,7 +77,7 @@ datasource_ptr datasource_cache::create(const parameters& params) if ( itr == plugins_.end() ) { throw config_error(string("Could not create datasource. No plugin ") + - "found for type '" + * type + "'"); + "found for type '" + * type + "' (searched in: " + plugin_directories() + ")"); } if ( ! itr->second->handle()) { @@ -114,6 +115,11 @@ bool datasource_cache::insert(const std::string& type,const lt_dlhandle module) (new PluginInfo(type,module)))).second; } +std::string datasource_cache::plugin_directories() +{ + return boost::algorithm::join(plugin_directories_,", "); +} + std::vector datasource_cache::plugin_names () { std::vector names; @@ -132,6 +138,7 @@ void datasource_cache::register_datasources(const std::string& str) mapnik::CreateStatic>::mutex_); #endif filesystem::path path(str); + plugin_directories_.push_back(str); filesystem::directory_iterator end_itr;