mirror of
https://github.com/mapnik/mapnik.git
synced 2025-12-08 20:13:09 +00:00
+ make use of GDALOpenShared instead of GDALOpen, which could be better performing when using multiple equal datasource reads (no need to open multiple datasources, and yes it is still thread safe)
This commit is contained in:
parent
474dd54900
commit
9de066e035
@ -37,7 +37,7 @@ using mapnik::featureset_ptr;
|
||||
using mapnik::layer_descriptor;
|
||||
using mapnik::datasource_exception;
|
||||
|
||||
gdal_datasource::gdal_datasource( parameters const& params)
|
||||
gdal_datasource::gdal_datasource(parameters const& params)
|
||||
: datasource(params),
|
||||
extent_(),
|
||||
desc_(*params.get<std::string>("type"),"utf-8")
|
||||
@ -52,8 +52,9 @@ gdal_datasource::gdal_datasource( parameters const& params)
|
||||
else
|
||||
dataset_name_ = *file;
|
||||
|
||||
dataset_ = boost::shared_ptr<GDALDataset>(reinterpret_cast<GDALDataset*>(GDALOpen((dataset_name_).c_str(),GA_ReadOnly)));
|
||||
dataset_ = boost::shared_ptr<GDALDataset>(reinterpret_cast<GDALDataset*>(GDALOpenShared((dataset_name_).c_str(),GA_ReadOnly)));
|
||||
if (!dataset_) throw datasource_exception(CPLGetLastErrorMsg());
|
||||
|
||||
double tr[6];
|
||||
dataset_->GetGeoTransform(tr);
|
||||
double x0 = tr[0];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user