Merge pull request #2354 from kernelsanders/master
add ogr plugin error handling to master/3.x
This commit is contained in:
commit
522417835b
1 changed files with 7 additions and 1 deletions
|
@ -261,7 +261,13 @@ void ogr_datasource::init(mapnik::parameters const& params)
|
|||
else
|
||||
{
|
||||
OGREnvelope envelope;
|
||||
layer->GetExtent(&envelope);
|
||||
OGRErr e = layer->GetExtent(&envelope);
|
||||
if (e == OGRERR_FAILURE)
|
||||
{
|
||||
std::ostringstream s;
|
||||
s << "OGR Plugin: Extent missing for layer '" << layer->GetName() << "'. Use <extent> paramater to define a custom extent value.";
|
||||
throw datasource_exception(s.str());
|
||||
}
|
||||
extent_.init(envelope.MinX, envelope.MinY, envelope.MaxX, envelope.MaxY);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue