only move values into features

This commit is contained in:
Dane Springmeyer 2015-10-21 15:45:29 -07:00
parent a7e7f088a2
commit 6582908d10
7 changed files with 19 additions and 18 deletions

View file

@ -110,12 +110,13 @@ public:
inline mapnik::value_integer id() const { return id_;} inline mapnik::value_integer id() const { return id_;}
inline void set_id(mapnik::value_integer id) { id_ = id;} inline void set_id(mapnik::value_integer id) { id_ = id;}
/*
template <typename T> template <typename T>
inline void put(context_type::key_type const& key, T const& val) inline void put(context_type::key_type const& key, T const& val)
{ {
put(key, value(val)); put(key, value(val));
} }
*/
template <typename T> template <typename T>
inline void put_new(context_type::key_type const& key, T const& val) inline void put_new(context_type::key_type const& key, T const& val)
{ {

View file

@ -305,14 +305,14 @@ void render_group_symbolizer(group_symbolizer const& sym,
{ {
std::string col_idx_name = col_name; std::string col_idx_name = col_name;
boost::replace_all(col_idx_name, "%", col_idx_str); boost::replace_all(col_idx_name, "%", col_idx_str);
sub_feature->put(col_name, feature.get(col_idx_name)); sub_feature->put(col_name, mapnik::value(feature.get(col_idx_name)));
} }
} }
} }
else else
{ {
// non-indexed column // non-indexed column
sub_feature->put(col_name, feature.get(col_name)); sub_feature->put(col_name, mapnik::value(feature.get(col_name)));
} }
} }

View file

@ -126,13 +126,13 @@ feature_ptr ogr_featureset::next()
{ {
case OFTInteger: case OFTInteger:
{ {
feature->put<mapnik::value_integer>( fld_name, poFeature->GetFieldAsInteger(i)); feature->put( fld_name, poFeature->GetFieldAsInteger(i));
break; break;
} }
#if GDAL_VERSION_MAJOR >= 2 #if GDAL_VERSION_MAJOR >= 2
case OFTInteger64: case OFTInteger64:
{ {
feature->put<mapnik::value_integer>( fld_name, poFeature->GetFieldAsInteger64(i)); feature->put( fld_name, poFeature->GetFieldAsInteger64(i));
break; break;
} }
#endif #endif

View file

@ -149,13 +149,13 @@ feature_ptr ogr_index_featureset<filterT>::next()
{ {
case OFTInteger: case OFTInteger:
{ {
feature->put<mapnik::value_integer>(fld_name,poFeature->GetFieldAsInteger (i)); feature->put(fld_name,poFeature->GetFieldAsInteger (i));
break; break;
} }
#if GDAL_VERSION_MAJOR >= 2 #if GDAL_VERSION_MAJOR >= 2
case OFTInteger64: case OFTInteger64:
{ {
feature->put<mapnik::value_integer>( fld_name, poFeature->GetFieldAsInteger64(i)); feature->put( fld_name, poFeature->GetFieldAsInteger64(i));
break; break;
} }
#endif #endif

View file

@ -107,7 +107,7 @@ feature_ptr pgraster_featureset::next()
// TODO - extend feature class to know // TODO - extend feature class to know
// that its id is also an attribute to avoid // that its id is also an attribute to avoid
// this duplication // this duplication
feature->put<mapnik::value_integer>(name,val); feature->put(name,val);
++pos; ++pos;
} }
else else
@ -161,19 +161,19 @@ feature_ptr pgraster_featureset::next()
case 23: //int4 case 23: //int4
{ {
feature->put<mapnik::value_integer>(name, int4net(buf)); feature->put(name, int4net(buf));
break; break;
} }
case 21: //int2 case 21: //int2
{ {
feature->put<mapnik::value_integer>(name, int2net(buf)); feature->put(name, int2net(buf));
break; break;
} }
case 20: //int8/BigInt case 20: //int8/BigInt
{ {
feature->put<mapnik::value_integer>(name, int8net(buf)); feature->put(name, int8net(buf));
break; break;
} }

View file

@ -101,7 +101,7 @@ feature_ptr postgis_featureset::next()
feature = feature_factory::create(ctx_, val); feature = feature_factory::create(ctx_, val);
if (key_field_as_attribute_) if (key_field_as_attribute_)
{ {
feature->put<mapnik::value_integer>(name,val); feature->put(name,val);
} }
++pos; ++pos;
} }
@ -152,19 +152,19 @@ feature_ptr postgis_featureset::next()
case 23: //int4 case 23: //int4
{ {
feature->put<mapnik::value_integer>(name, int4net(buf)); feature->put(name, int4net(buf));
break; break;
} }
case 21: //int2 case 21: //int2
{ {
feature->put<mapnik::value_integer>(name, int2net(buf)); feature->put(name, int2net(buf));
break; break;
} }
case 20: //int8/BigInt case 20: //int8/BigInt
{ {
feature->put<mapnik::value_integer>(name, int8net(buf)); feature->put(name, int8net(buf));
break; break;
} }
@ -188,14 +188,14 @@ feature_ptr postgis_featureset::next()
case 1043: //varchar case 1043: //varchar
case 705: //literal case 705: //literal
{ {
feature->put(name, tr_->transcode(buf)); feature->put(name, std::move(tr_->transcode(buf)));
break; break;
} }
case 1042: //bpchar case 1042: //bpchar
{ {
std::string str = mapnik::util::trim_copy(buf); std::string str = mapnik::util::trim_copy(buf);
feature->put(name, tr_->transcode(str.c_str())); feature->put(name, std::move(tr_->transcode(str.c_str())));
break; break;
} }

View file

@ -116,7 +116,7 @@ feature_ptr sqlite_featureset::next()
{ {
case SQLITE_INTEGER: case SQLITE_INTEGER:
{ {
feature->put<mapnik::value_integer>(fld_name_str, rs_->column_integer64(i)); feature->put(fld_name_str, rs_->column_integer64(i));
break; break;
} }