Move attribute type coercion out of parsing and into serialization

This commit is contained in:
Eric Fischer
2017-08-24 17:27:30 -07:00
parent f4818ffb07
commit e7ee83f27b
8 changed files with 65 additions and 52 deletions
+2 -4
View File
@@ -257,8 +257,7 @@ std::vector<mvt_layer> parse_layers(int fd, int z, unsigned x, unsigned y, std::
int tp = -1;
std::string s;
std::map<std::string, int> nullmap;
stringify_value(properties->values[i], tp, s, "Filter output", jp->line, j, "", &nullmap);
stringify_value(properties->values[i], tp, s, "Filter output", jp->line, j, "");
if (tp >= 0) {
mvt_value v = stringified_to_mvt_value(tp, s.c_str());
l->second.tag(feature, std::string(properties->keys[i]->string), v);
@@ -487,8 +486,7 @@ serial_feature parse_feature(json_pull *jp, int z, unsigned x, unsigned y, std::
serial_val v;
v.type = -1;
std::map<std::string, int> nullmap;
stringify_value(properties->values[i], v.type, v.s, "Filter output", jp->line, j, "", &nullmap);
stringify_value(properties->values[i], v.type, v.s, "Filter output", jp->line, j, "");
if (v.type >= 0) {
sf.full_keys.push_back(std::string(properties->keys[i]->string));