raster.input - attempt getting bounding box from image_reader
This commit is contained in:
parent
74c96f0bda
commit
1dfad4b10b
1 changed files with 10 additions and 0 deletions
|
@ -84,6 +84,16 @@ raster_datasource::raster_datasource(parameters const& params)
|
|||
{
|
||||
extent_initialized_ = extent_.from_string(*ext);
|
||||
}
|
||||
else //bounding box from image_reader
|
||||
{
|
||||
std::unique_ptr<image_reader> reader(mapnik::get_image_reader(*file));
|
||||
auto bbox = reader->bounding_box();
|
||||
if (bbox)
|
||||
{
|
||||
extent_ = *bbox;
|
||||
extent_initialized_ = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (! extent_initialized_)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue