本文整理汇总了C++中mapnik::feature_impl::end方法的典型用法代码示例。如果您正苦于以下问题:C++ feature_impl::end方法的具体用法?C++ feature_impl::end怎么用?C++ feature_impl::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mapnik::feature_impl
的用法示例。
在下文中一共展示了feature_impl::end方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: start_tile_feature
void start_tile_feature(mapnik::feature_impl const& feature)
{
current_feature_ = current_layer_->add_features();
x_ = y_ = 0;
// TODO - encode as sint64: (n << 1) ^ ( n >> 63)
// test current behavior with negative numbers
current_feature_->set_id(feature.id());
feature_kv_iterator itr = feature.begin();
feature_kv_iterator end = feature.end();
for ( ;itr!=end; ++itr)
{
std::string const& name = MAPNIK_GET<0>(*itr);
mapnik::value const& val = MAPNIK_GET<1>(*itr);
if (!val.is_null())
{
// Insert the key index
keys_container::const_iterator key_itr = keys_.find(name);
if (key_itr == keys_.end())
{
// The key doesn't exist yet in the dictionary.
current_layer_->add_keys(name.c_str(), name.length());
size_t index = keys_.size();
keys_.insert(keys_container::value_type(name, index));
current_feature_->add_tags(index);
}
else
{
current_feature_->add_tags(key_itr->second);
}
// Insert the value index
values_container::const_iterator val_itr = values_.find(val);
if (val_itr == values_.end())
{
// The value doesn't exist yet in the dictionary.
to_tile_value visitor(current_layer_->add_values());
#if MAPNIK_VERSION >= 300000
MAPNIK_APPLY_VISITOR(visitor, val);
#else
MAPNIK_APPLY_VISITOR(visitor, val.base());
#endif
size_t index = values_.size();
values_.insert(values_container::value_type(val, index));
current_feature_->add_tags(index);
}
else
{
current_feature_->add_tags(val_itr->second);
}
}
}
}