mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-02 16:35:40 +02:00
More serial_val cleanup
This commit is contained in:
+7
-21
@@ -264,23 +264,16 @@ std::vector<mvt_layer> parse_layers(int fd, int z, unsigned x, unsigned y, std::
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < properties->value.object.length; i++) {
|
||||
int tp = -1;
|
||||
std::string s;
|
||||
|
||||
stringify_value(properties->value.object.values[i], tp, s, "Filter output", jp->line, j);
|
||||
serial_val sv = stringify_value(properties->value.object.values[i], "Filter output", jp->line, j);
|
||||
|
||||
// Nulls can be excluded here because this is the postfilter
|
||||
// and it is nearly time to create the vector representation
|
||||
|
||||
if (tp >= 0 && tp != mvt_null) {
|
||||
mvt_value v = stringified_to_mvt_value(tp, s.c_str(), tile_stringpool);
|
||||
if (sv.type != mvt_null) {
|
||||
mvt_value v = stringified_to_mvt_value(sv.type, sv.s.c_str(), tile_stringpool);
|
||||
l->second.tag(feature, std::string(properties->value.object.keys[i]->value.string.string), v);
|
||||
|
||||
serial_val attrib;
|
||||
attrib.type = tp;
|
||||
attrib.s = s;
|
||||
|
||||
add_to_tilestats(ts->second.tilestats, std::string(properties->value.object.keys[i]->value.string.string), attrib);
|
||||
add_to_tilestats(ts->second.tilestats, std::string(properties->value.object.keys[i]->value.string.string), sv);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -505,24 +498,17 @@ serial_feature parse_feature(json_pull *jp, int z, unsigned x, unsigned y, std::
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < properties->value.object.length; i++) {
|
||||
serial_val v;
|
||||
v.type = -1;
|
||||
|
||||
stringify_value(properties->value.object.values[i], v.type, v.s, "Filter output", jp->line, j);
|
||||
serial_val v = stringify_value(properties->value.object.values[i], "Filter output", jp->line, j);
|
||||
|
||||
// Nulls can be excluded here because the expression evaluation filter
|
||||
// would have already run before prefiltering
|
||||
|
||||
if (v.type >= 0 && v.type != mvt_null) {
|
||||
if (v.type != mvt_null) {
|
||||
sf.full_keys.push_back(std::string(properties->value.object.keys[i]->value.string.string));
|
||||
sf.full_values.push_back(v);
|
||||
|
||||
serial_val attrib;
|
||||
attrib.s = v.s;
|
||||
attrib.type = v.type;
|
||||
|
||||
if (!postfilter) {
|
||||
add_to_tilestats(ts->second.tilestats, std::string(properties->value.object.keys[i]->value.string.string), attrib);
|
||||
add_to_tilestats(ts->second.tilestats, std::string(properties->value.object.keys[i]->value.string.string), v);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user