Change representation of null/true/false to match vector-tile-base

This commit is contained in:
Eric Fischer 2018-10-31 10:43:21 -07:00
parent 719b5b8754
commit 4a5aebea43

View File

@ -935,10 +935,10 @@ void mvt_layer::tag_v3_value(mvt_value value, std::vector<unsigned long> &onto)
}
onto.push_back(vo);
} else if (value.type == mvt_bool) {
vo = (value.numeric_value.bool_value << 4) | 7;
vo = ((value.numeric_value.bool_value + 1) << 4) | 7;
onto.push_back(vo);
} else if (value.type == mvt_null) {
vo = (2 << 4) | 7;
vo = (0 << 4) | 7;
onto.push_back(vo);
} else if (value.type == mvt_list) {
bool all_ints = true;
@ -1137,12 +1137,12 @@ mvt_value mvt_layer::decode_property(std::vector<unsigned long> const &property,
return ret;
case 7: /* boolean */
if ((property[off] >> 4) == 2) {
if ((property[off] >> 4) == 0) {
ret.type = mvt_null;
ret.numeric_value.null_value = 0;
} else {
ret.type = mvt_bool;
ret.numeric_value.bool_value = property[off] >> 4;
ret.numeric_value.bool_value = (property[off] >> 4) - 1;
}
return ret;