Fixes bool atrributes coming from FGB files (#289)

Fixes https://github.com/felt/tippecanoe/issues/180.

Co-authored-by: Patrick Young <pyoung@snapchat.com>
This commit is contained in:
Patrick M Young
2024-11-01 12:27:05 -07:00
committed by GitHub
co-authored by Patrick Young
parent 28efc40e6e
commit 120b8f4e41
+5 -1
View File
@@ -177,7 +177,11 @@ void readFeature(const FlatGeobuf::Feature *feature, long long feature_sequence_
sv.type = mvt_bool; sv.type = mvt_bool;
uint8_t bool_val; uint8_t bool_val;
memcpy(&bool_val, feature->properties()->data() + p_pos + sizeof(uint16_t), sizeof(bool_val)); memcpy(&bool_val, feature->properties()->data() + p_pos + sizeof(uint16_t), sizeof(bool_val));
sv.s = std::to_string(bool_val); if (bool_val) {
sv.s = "true";
} else {
sv.s = "false";
}
p_pos += sizeof(uint16_t) + sizeof(bool_val); p_pos += sizeof(uint16_t) + sizeof(bool_val);
} else if (col_type == FlatGeobuf::ColumnType_Short) { } else if (col_type == FlatGeobuf::ColumnType_Short) {
sv.type = mvt_sint; sv.type = mvt_sint;