mirror of
https://github.com/mapbox/tippecanoe.git
synced 2025-02-23 18:40:17 +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);
|
onto.push_back(vo);
|
||||||
} else if (value.type == mvt_bool) {
|
} 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);
|
onto.push_back(vo);
|
||||||
} else if (value.type == mvt_null) {
|
} else if (value.type == mvt_null) {
|
||||||
vo = (2 << 4) | 7;
|
vo = (0 << 4) | 7;
|
||||||
onto.push_back(vo);
|
onto.push_back(vo);
|
||||||
} else if (value.type == mvt_list) {
|
} else if (value.type == mvt_list) {
|
||||||
bool all_ints = true;
|
bool all_ints = true;
|
||||||
@ -1137,12 +1137,12 @@ mvt_value mvt_layer::decode_property(std::vector<unsigned long> const &property,
|
|||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
case 7: /* boolean */
|
case 7: /* boolean */
|
||||||
if ((property[off] >> 4) == 2) {
|
if ((property[off] >> 4) == 0) {
|
||||||
ret.type = mvt_null;
|
ret.type = mvt_null;
|
||||||
ret.numeric_value.null_value = 0;
|
ret.numeric_value.null_value = 0;
|
||||||
} else {
|
} else {
|
||||||
ret.type = mvt_bool;
|
ret.type = mvt_bool;
|
||||||
ret.numeric_value.bool_value = property[off] >> 4;
|
ret.numeric_value.bool_value = (property[off] >> 4) - 1;
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user