Skip to content

Commit

Permalink
only move values into features
Browse files Browse the repository at this point in the history
  • Loading branch information
Dane Springmeyer committed Oct 21, 2015
1 parent a7e7f08 commit 6582908
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 18 deletions.
3 changes: 2 additions & 1 deletion include/mapnik/feature.hpp
Expand Up @@ -110,12 +110,13 @@ class MAPNIK_DECL feature_impl : private util::noncopyable

inline mapnik::value_integer id() const { return id_;}
inline void set_id(mapnik::value_integer id) { id_ = id;}
/*
template <typename T>
inline void put(context_type::key_type const& key, T const& val)
{
put(key, value(val));
}

*/
template <typename T>
inline void put_new(context_type::key_type const& key, T const& val)
{
Expand Down
4 changes: 2 additions & 2 deletions include/mapnik/renderer_common/process_group_symbolizer.hpp
Expand Up @@ -305,14 +305,14 @@ void render_group_symbolizer(group_symbolizer const& sym,
{
std::string col_idx_name = col_name;
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
{
// non-indexed column
sub_feature->put(col_name, feature.get(col_name));
sub_feature->put(col_name, mapnik::value(feature.get(col_name)));
}
}

Expand Down
4 changes: 2 additions & 2 deletions plugins/input/ogr/ogr_featureset.cpp
Expand Up @@ -126,13 +126,13 @@ feature_ptr ogr_featureset::next()
{
case OFTInteger:
{
feature->put<mapnik::value_integer>( fld_name, poFeature->GetFieldAsInteger(i));
feature->put( fld_name, poFeature->GetFieldAsInteger(i));
break;
}
#if GDAL_VERSION_MAJOR >= 2
case OFTInteger64:
{
feature->put<mapnik::value_integer>( fld_name, poFeature->GetFieldAsInteger64(i));
feature->put( fld_name, poFeature->GetFieldAsInteger64(i));
break;
}
#endif
Expand Down
4 changes: 2 additions & 2 deletions plugins/input/ogr/ogr_index_featureset.cpp
Expand Up @@ -149,13 +149,13 @@ feature_ptr ogr_index_featureset<filterT>::next()
{
case OFTInteger:
{
feature->put<mapnik::value_integer>(fld_name,poFeature->GetFieldAsInteger (i));
feature->put(fld_name,poFeature->GetFieldAsInteger (i));
break;
}
#if GDAL_VERSION_MAJOR >= 2
case OFTInteger64:
{
feature->put<mapnik::value_integer>( fld_name, poFeature->GetFieldAsInteger64(i));
feature->put( fld_name, poFeature->GetFieldAsInteger64(i));
break;
}
#endif
Expand Down
8 changes: 4 additions & 4 deletions plugins/input/pgraster/pgraster_featureset.cpp
Expand Up @@ -107,7 +107,7 @@ feature_ptr pgraster_featureset::next()
// TODO - extend feature class to know
// that its id is also an attribute to avoid
// this duplication
feature->put<mapnik::value_integer>(name,val);
feature->put(name,val);
++pos;
}
else
Expand Down Expand Up @@ -161,19 +161,19 @@ feature_ptr pgraster_featureset::next()

case 23: //int4
{
feature->put<mapnik::value_integer>(name, int4net(buf));
feature->put(name, int4net(buf));
break;
}

case 21: //int2
{
feature->put<mapnik::value_integer>(name, int2net(buf));
feature->put(name, int2net(buf));
break;
}

case 20: //int8/BigInt
{
feature->put<mapnik::value_integer>(name, int8net(buf));
feature->put(name, int8net(buf));
break;
}

Expand Down
12 changes: 6 additions & 6 deletions plugins/input/postgis/postgis_featureset.cpp
Expand Up @@ -101,7 +101,7 @@ feature_ptr postgis_featureset::next()
feature = feature_factory::create(ctx_, val);
if (key_field_as_attribute_)
{
feature->put<mapnik::value_integer>(name,val);
feature->put(name,val);
}
++pos;
}
Expand Down Expand Up @@ -152,19 +152,19 @@ feature_ptr postgis_featureset::next()

case 23: //int4
{
feature->put<mapnik::value_integer>(name, int4net(buf));
feature->put(name, int4net(buf));
break;
}

case 21: //int2
{
feature->put<mapnik::value_integer>(name, int2net(buf));
feature->put(name, int2net(buf));
break;
}

case 20: //int8/BigInt
{
feature->put<mapnik::value_integer>(name, int8net(buf));
feature->put(name, int8net(buf));
break;
}

Expand All @@ -188,14 +188,14 @@ feature_ptr postgis_featureset::next()
case 1043: //varchar
case 705: //literal
{
feature->put(name, tr_->transcode(buf));
feature->put(name, std::move(tr_->transcode(buf)));
break;
}

case 1042: //bpchar
{
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;
}

Expand Down
2 changes: 1 addition & 1 deletion plugins/input/sqlite/sqlite_featureset.cpp
Expand Up @@ -116,7 +116,7 @@ feature_ptr sqlite_featureset::next()
{
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;
}

Expand Down

0 comments on commit 6582908

Please sign in to comment.