mirror of
https://github.com/mapbox/tippecanoe.git
synced 2025-02-23 02:22:34 +00:00
Change representation of null/true/false to match vector-tile-base
This commit is contained in:
parent
719b5b8754
commit
4a5aebea43
8
mvt.cpp
8
mvt.cpp
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user