don't call *params.get<std::string>("type"), instead use static datasource::name()

(FIXME: consider removing redundant 'name' in feature_layer_descriptor)
This commit is contained in:
artemp 2014-06-26 10:51:24 +01:00
parent b197cbcdb7
commit 0702679bb0
15 changed files with 44 additions and 43 deletions

View file

@ -58,7 +58,7 @@ DATASOURCE_PLUGIN(csv_datasource)
csv_datasource::csv_datasource(parameters const& params)
: datasource(params),
desc_(*params.get<std::string>("type"), *params.get<std::string>("encoding", "utf-8")),
desc_(csv_datasource::name(), *params.get<std::string>("encoding", "utf-8")),
extent_(),
filename_(),
inline_string_(),

View file

@ -76,7 +76,7 @@ inline GDALDataset* gdal_datasource::open_dataset() const
gdal_datasource::gdal_datasource(parameters const& params)
: datasource(params),
desc_(*params.get<std::string>("type"), "utf-8"),
desc_(gdal_datasource::name(), "utf-8"),
nodata_value_(params.get<double>("nodata")),
nodata_tolerance_(*params.get<double>("nodata_tolerance",1e-12))
{

View file

@ -96,7 +96,7 @@ struct attr_value_converter : public boost::static_visitor<mapnik::eAttributeTyp
geojson_datasource::geojson_datasource(parameters const& params)
: datasource(params),
type_(datasource::Vector),
desc_(*params.get<std::string>("type"),
desc_(geojson_datasource::name(),
*params.get<std::string>("encoding","utf-8")),
file_(*params.get<std::string>("file","")),
extent_(),

View file

@ -76,7 +76,7 @@ occi_datasource::occi_datasource(parameters const& params)
scale_denom_token_("!scale_denominator!"),
pixel_width_token_("!pixel_width!"),
pixel_height_token_("!pixel_height!"),
desc_(*params.get<std::string>("type"), *params.get<std::string>("encoding", "utf-8")),
desc_(occi_datasource::name(), *params.get<std::string>("encoding", "utf-8")),
use_wkb_(*params.get<mapnik::boolean>("use_wkb", false)),
row_limit_(*params.get<mapnik::value_integer>("row_limit", 0)),
row_prefetch_(*params.get<int>("row_prefetch", 100)),

View file

@ -61,7 +61,7 @@ ogr_datasource::ogr_datasource(parameters const& params)
: datasource(params),
extent_(),
type_(datasource::Vector),
desc_(*params.get<std::string>("type"), *params.get<std::string>("encoding", "utf-8")),
desc_(ogr_datasource::name(), *params.get<std::string>("encoding", "utf-8")),
indexed_(false)
{
init(params);

View file

@ -52,7 +52,7 @@ osm_datasource::osm_datasource(const parameters& params)
: datasource (params),
extent_(),
type_(datasource::Vector),
desc_(*params.get<std::string>("type"), *params.get<std::string>("encoding", "utf-8"))
desc_(osm_datasource::name(), *params.get<std::string>("encoding", "utf-8"))
{
osm_data_ = nullptr;
std::string osm_filename = *params.get<std::string>("file", "");

View file

@ -70,7 +70,7 @@ postgis_datasource::postgis_datasource(parameters const& params)
srid_(*params.get<mapnik::value_integer>("srid", 0)),
extent_initialized_(false),
simplify_geometries_(false),
desc_(*params.get<std::string>("type"), "utf-8"),
desc_(postgis_datasource::name(), "utf-8"),
creator_(params.get<std::string>("host"),
params.get<std::string>("port"),
params.get<std::string>("dbname"),

View file

@ -21,7 +21,7 @@ DATASOURCE_PLUGIN(python_datasource)
python_datasource::python_datasource(parameters const& params)
: datasource(params),
desc_(*params.get<std::string>("type"), *params.get<std::string>("encoding","utf-8")),
desc_(python_datasource::name(), *params.get<std::string>("encoding","utf-8")),
factory_(*params.get<std::string>("factory", ""))
{
// extract any remaining parameters as keyword args for the factory

View file

@ -47,7 +47,7 @@ DATASOURCE_PLUGIN(raster_datasource)
raster_datasource::raster_datasource(parameters const& params)
: datasource(params),
desc_(*params.get<std::string>("type"), "utf-8"),
desc_(raster_datasource::name(), "utf-8"),
extent_initialized_(false)
{
MAPNIK_LOG_DEBUG(raster) << "raster_datasource: Initializing...";

View file

@ -72,7 +72,7 @@ inline void* rasterlite_datasource::open_dataset() const
rasterlite_datasource::rasterlite_datasource(parameters const& params)
: datasource(params),
desc_(*params.get<std::string>("type"),"utf-8")
desc_(rasterlite_datasource::name(),"utf-8")
{
MAPNIK_LOG_DEBUG(rasterlite) << "rasterlite_datasource: Initializing...";

View file

@ -62,7 +62,7 @@ shape_datasource::shape_datasource(parameters const& params)
file_length_(0),
indexed_(false),
row_limit_(*params.get<mapnik::value_integer>("row_limit",0)),
desc_(*params.get<std::string>("type"), *params.get<std::string>("encoding","utf-8"))
desc_(shape_datasource::name(), *params.get<std::string>("encoding","utf-8"))
{
#ifdef MAPNIK_STATS
mapnik::progress_timer __stats__(std::clog, "shape_datasource::init");

View file

@ -66,7 +66,7 @@ sqlite_datasource::sqlite_datasource(parameters const& params)
row_offset_(*params.get<mapnik::value_integer>("row_offset", 0)),
row_limit_(*params.get<mapnik::value_integer>("row_limit", 0)),
intersects_token_("!intersects!"),
desc_(*params.get<std::string>("type"), *params.get<std::string>("encoding", "utf-8")),
desc_(sqlite_datasource::name(), *params.get<std::string>("encoding", "utf-8")),
format_(mapnik::wkbAuto)
{
/* TODO

View file

@ -12,7 +12,7 @@ DATASOURCE_PLUGIN(hello_datasource)
hello_datasource::hello_datasource(parameters const& params)
: datasource(params),
desc_(*params.get<std::string>("type"), *params.get<std::string>("encoding","utf-8")),
desc_(hello_datasource::name(), *params.get<std::string>("encoding","utf-8")),
extent_()
{
this->init(params);

View file

@ -143,7 +143,7 @@ struct collect_attributes_visitor : public boost::static_visitor<void>
topojson_datasource::topojson_datasource(parameters const& params)
: datasource(params),
type_(datasource::Vector),
desc_(*params.get<std::string>("type"),
desc_(topojson_datasource::name(),
*params.get<std::string>("encoding","utf-8")),
file_(*params.get<std::string>("file","")),
extent_(),

View file

@ -72,7 +72,8 @@ const char * memory_datasource::name()
memory_datasource::memory_datasource(parameters const& params)
: datasource(params),
desc_(*params.get<std::string>("type"), *params.get<std::string>("encoding","utf-8")),
desc_(memory_datasource::name(),
*params.get<std::string>("encoding","utf-8")),
type_(datasource::Vector),
bbox_check_(*params.get<boolean>("bbox_check", true)) {}