diff --git a/plugins/input/osm/build.py b/plugins/input/osm/build.py index 8355ef5cc..2e95f66d9 100644 --- a/plugins/input/osm/build.py +++ b/plugins/input/osm/build.py @@ -41,6 +41,8 @@ libraries = [ 'xml2' ] libraries.append('curl') libraries.append('mapnik') libraries.append(env['ICU_LIB_NAME']) +libraries.append('boost_system%s' % env['BOOST_APPEND']) +libraries.append('boost_filesystem%s' % env['BOOST_APPEND']) input_plugin = plugin_env.SharedLibrary('../osm', source=osm_src, SHLIBPREFIX='', SHLIBSUFFIX='.input', LIBS=libraries, LINKFLAGS=env['CUSTOM_LDFLAGS']) diff --git a/plugins/input/osm/dataset_deliverer.cpp b/plugins/input/osm/dataset_deliverer.cpp index 6bb33670d..694bcd8a7 100644 --- a/plugins/input/osm/dataset_deliverer.cpp +++ b/plugins/input/osm/dataset_deliverer.cpp @@ -20,6 +20,8 @@ * *****************************************************************************/ +#include +#include #include "dataset_deliverer.h" #include "basiccurl.h" #include @@ -33,6 +35,11 @@ osm_dataset* dataset_deliverer::load_from_file(const string& file, const string& // Only actually load from file if we haven't done so already if (dataset == NULL) { + if (!boost::filesystem::exists(file)) + { + throw mapnik::datasource_exception("OSM Plugin: '" + file + "' does not exist"); + } + dataset = new osm_dataset; if (dataset->load(file.c_str(), parser) == false) { diff --git a/plugins/input/osm/osm_datasource.cpp b/plugins/input/osm/osm_datasource.cpp index 570346670..3098c992f 100644 --- a/plugins/input/osm/osm_datasource.cpp +++ b/plugins/input/osm/osm_datasource.cpp @@ -22,6 +22,7 @@ // stl #include +#include #include #include #include @@ -91,7 +92,9 @@ void osm_datasource::bind() const { if ((osm_data_= dataset_deliverer::load_from_file(osm_filename, parser)) == NULL) { - throw datasource_exception("Error loading from file"); + std::ostringstream s; + s << "OSM Plugin: Error loading from file '" << osm_filename << "'"; + throw datasource_exception(s.str()); } do_process = true;