Be more systematic about nulls and undefined attribute values

It is an error to write a null attribute to a tile, but
null attributes found within existing tiles will be decoded
into JSON as null.
This commit is contained in:
Eric Fischer
2018-06-06 11:48:01 -07:00
parent 6e231f5911
commit 2318673108
3 changed files with 21 additions and 1 deletions
+6
View File
@@ -337,6 +337,12 @@ void layer_to_geojson(mvt_layer const &layer, unsigned z, unsigned x, unsigned y
} else if (val.type == mvt_bool) {
state.json_write_string(key);
state.json_write_bool(val.numeric_value.bool_value);
} else if (val.type == mvt_null) {
state.json_write_string(key);
state.json_write_null();
} else {
fprintf(stderr, "Internal error: property with unknown type\n");
exit(EXIT_FAILURE);
}
}