Carry attribute keys and values through from the prefilter

This commit is contained in:
Eric Fischer 2016-12-09 15:54:47 -08:00
parent 0e5b513637
commit 5dc773ffae

View File

@ -78,6 +78,7 @@ struct coalesce {
char *stringpool; char *stringpool;
std::vector<long long> keys; std::vector<long long> keys;
std::vector<long long> values; std::vector<long long> values;
std::map<std::string, serial_val> kv;
drawvec geom; drawvec geom;
unsigned long long index; unsigned long long index;
unsigned long long index2; unsigned long long index2;
@ -314,6 +315,7 @@ struct partial {
std::vector<drawvec> geoms; std::vector<drawvec> geoms;
std::vector<long long> keys; std::vector<long long> keys;
std::vector<long long> values; std::vector<long long> values;
std::map<std::string, serial_val> kv;
std::vector<ssize_t> arc_polygon; std::vector<ssize_t> arc_polygon;
long long layer; long long layer;
long long original_seq; long long original_seq;
@ -1585,6 +1587,7 @@ long long write_tile(FILE *geoms, long long *geompos_in, char *metabase, char *s
p.maxzoom = maxzoom; p.maxzoom = maxzoom;
p.keys = sf.keys; p.keys = sf.keys;
p.values = sf.values; p.values = sf.values;
p.kv = sf.kv;
p.spacing = spacing; p.spacing = spacing;
p.simplification = simplification; p.simplification = simplification;
p.id = sf.id; p.id = sf.id;
@ -1682,6 +1685,7 @@ long long write_tile(FILE *geoms, long long *geompos_in, char *metabase, char *s
c.stringpool = stringpool + pool_off[partials[i].segment]; c.stringpool = stringpool + pool_off[partials[i].segment];
c.keys = partials[i].keys; c.keys = partials[i].keys;
c.values = partials[i].values; c.values = partials[i].values;
c.kv = partials[i].kv;
c.spacing = partials[i].spacing; c.spacing = partials[i].spacing;
c.id = partials[i].id; c.id = partials[i].id;
c.has_id = partials[i].has_id; c.has_id = partials[i].has_id;
@ -1798,6 +1802,10 @@ long long write_tile(FILE *geoms, long long *geompos_in, char *metabase, char *s
feature.has_id = layer_features[x].has_id; feature.has_id = layer_features[x].has_id;
decode_meta(layer_features[x].m, layer_features[x].keys, layer_features[x].values, layer_features[x].stringpool, layer, feature); decode_meta(layer_features[x].m, layer_features[x].keys, layer_features[x].values, layer_features[x].stringpool, layer, feature);
for (auto kv : layer_features[x].kv) {
mvt_value v = stringified_to_mvt_value(kv.second.type, kv.second.s.c_str());
layer.tag(feature, kv.first, v);
}
if (additional[A_CALCULATE_FEATURE_DENSITY]) { if (additional[A_CALCULATE_FEATURE_DENSITY]) {
int glow = 255; int glow = 255;