check for the existance of a shape index before trying to open it
This commit is contained in:
parent
128a7ddc5b
commit
826282a47f
1 changed files with 6 additions and 1 deletions
|
@ -24,7 +24,7 @@
|
|||
|
||||
#include "shape_io.hpp"
|
||||
#include "shape.hpp"
|
||||
|
||||
#include <boost/filesystem/operations.hpp>
|
||||
|
||||
using mapnik::datasource_exception;
|
||||
using mapnik::geometry_type;
|
||||
|
@ -47,6 +47,11 @@ shape_io::shape_io(const std::string& shape_name)
|
|||
}
|
||||
try
|
||||
{
|
||||
if (!boost::filesystem::exists(shape_name + INDEX))
|
||||
{
|
||||
throw datasource_exception("Shape Plugin Warning: Could not open index: '" + shape_name + INDEX + "' does not exist");
|
||||
}
|
||||
|
||||
index_= boost::shared_ptr<shape_file>(new shape_file(shape_name + INDEX));
|
||||
}
|
||||
catch (...)
|
||||
|
|
Loading…
Reference in a new issue