+ check if *.sqlite file exists and avoid creating a new one
This commit is contained in:
parent
0e8b0a0668
commit
bad446da1d
2 changed files with 6 additions and 1 deletions
|
@ -36,7 +36,9 @@ if env['PLATFORM'] == 'Darwin':
|
|||
libraries.append('mapnik')
|
||||
libraries.append('icuuc')
|
||||
libraries.append('icudata')
|
||||
|
||||
libraries.append('boost_system%s' % env['BOOST_APPEND'])
|
||||
libraries.append('boost_filesystem%s' % env['BOOST_APPEND'])
|
||||
|
||||
sqlite_inputdriver = env.SharedLibrary('sqlite', source=sqlite_src, SHLIBPREFIX='', SHLIBSUFFIX='.input', LIBS=libraries)
|
||||
|
||||
env.Install(install_prefix + '/' + env['LIBDIR_SCHEMA'] + env['LIB_DIR_NAME'] + '/input', sqlite_inputdriver)
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include <boost/algorithm/string.hpp>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include <boost/tokenizer.hpp>
|
||||
#include <boost/filesystem/operations.hpp>
|
||||
|
||||
using std::clog;
|
||||
using std::endl;
|
||||
|
@ -102,6 +103,8 @@ sqlite_datasource::sqlite_datasource(parameters const& params)
|
|||
multiple_geometries_ = *params_.get<mapnik::boolean>("multiple_geometries",false);
|
||||
use_spatial_index_ = *params_.get<mapnik::boolean>("use_spatial_index",true);
|
||||
|
||||
if (!boost::filesystem::exists(*file)) throw datasource_exception(*file + " don't exists");
|
||||
|
||||
dataset_ = new sqlite_connection (*file);
|
||||
|
||||
boost::optional<std::string> ext = params_.get<std::string>("extent");
|
||||
|
|
Loading…
Add table
Reference in a new issue