@@ -1157,14 +1157,14 @@ static void feature_out(std::vector<tile_feature> const &features, mvt_layer &ou
1157
1157
std::map<std::string, size_t > numeric_out_field;
1158
1158
1159
1159
for (size_t i = 0 ; i + 1 < features[0 ].tags .size (); i += 2 ) {
1160
- auto f = attribute_accum.find (features[0 ].layer ->keys [features[0 ].tags [i]]);
1160
+ const std::string &key = features[0 ].layer ->keys [features[0 ].tags [i]];
1161
+ auto f = attribute_accum.find (key);
1161
1162
if (f != attribute_accum.end ()) {
1162
1163
// this attribute has an accumulator, so convert it
1163
1164
full_keys.push_back (features[0 ].layer ->keys [features[0 ].tags [i]]);
1164
1165
full_values.push_back (mvt_value_to_serial_val (features[0 ].layer ->values [features[0 ].tags [i + 1 ]]));
1165
1166
} else if (accumulate_numeric && features[0 ].layer ->values [features[0 ].tags [i + 1 ]].is_numeric ()) {
1166
1167
// convert numeric for accumulation
1167
- const std::string &key = features[0 ].layer ->keys [features[0 ].tags [i]];
1168
1168
numeric_out_field.emplace (key, full_keys.size ());
1169
1169
full_keys.push_back (key);
1170
1170
full_values.push_back (mvt_value_to_serial_val (features[0 ].layer ->values [features[0 ].tags [i + 1 ]]));
@@ -1202,8 +1202,9 @@ static void feature_out(std::vector<tile_feature> const &features, mvt_layer &ou
1202
1202
// same attribute, we want to use that one instead of this one.
1203
1203
1204
1204
for (auto const &op : numeric_operations) {
1205
- auto compound_found = keys.find (" tipppecanoe:" + op.first + " :" + key);
1206
- if (compound_found == keys.end ()) {
1205
+ std::string compound_key = " tipppecanoe:" + op.first + " :" + key;
1206
+ auto compound_found = keys.find (compound_key);
1207
+ if (compound_found != keys.end ()) {
1207
1208
// found, so skip this one
1208
1209
} else {
1209
1210
// not found, so accumulate this one
0 commit comments