mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-02 16:35:40 +02:00
Add a new option to set an initial value for an attribute in each feature (#115)
* Starting on --set-attributes * Add a JSON form to accumulate-attribute * Fix formatting * Set attributes, JSON form * Also handle setting attributes to unquoted values * Factoring out character-mangling in the names of tests * Rename tests for new quoting convention * Test for JSON form of attribute setting * Test for JSON form of attribute accumulation * Forgot to increment the version
This commit is contained in:
@@ -629,6 +629,11 @@ int serialize_feature(struct serialization_state *sst, serial_feature &sf) {
|
||||
exit(EXIT_IMPOSSIBLE);
|
||||
}
|
||||
|
||||
for (auto &kv : set_attributes) {
|
||||
sf.full_keys.push_back(kv.first);
|
||||
sf.full_values.push_back(kv.second);
|
||||
}
|
||||
|
||||
for (ssize_t i = (ssize_t) sf.full_keys.size() - 1; i >= 0; i--) {
|
||||
coerce_value(sf.full_keys[i], sf.full_values[i].type, sf.full_values[i].s, sst->attribute_types);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user