Merge branch 'master' into custom-variant-2

This commit is contained in:
artemp 2014-08-13 09:06:58 +01:00
commit 1d02eb0d1d

View file

@ -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);
}