mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-06 10:25:41 +02:00
Allow --set-attribute to override existing attribute values (#123)
* Allow --set-attribute to override existing attribute values * Bump version number
This commit is contained in:
@@ -1,3 +1,7 @@
|
|||||||
|
# 2.28.1
|
||||||
|
|
||||||
|
* Allow --set-attribute to override an existing attribute value
|
||||||
|
|
||||||
# 2.28.0
|
# 2.28.0
|
||||||
|
|
||||||
* Add --preserve-point-density-threshold option to reduce blank areas of the map at low zooms
|
* Add --preserve-point-density-threshold option to reduce blank areas of the map at low zooms
|
||||||
|
|||||||
+11
@@ -630,9 +630,20 @@ int serialize_feature(struct serialization_state *sst, serial_feature &sf) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (auto &kv : set_attributes) {
|
for (auto &kv : set_attributes) {
|
||||||
|
bool found = false;
|
||||||
|
for (size_t i = 0; i < sf.full_keys.size(); i++) {
|
||||||
|
if (sf.full_keys[i] == kv.first) {
|
||||||
|
sf.full_values[i] = kv.second;
|
||||||
|
found = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!found) {
|
||||||
sf.full_keys.push_back(kv.first);
|
sf.full_keys.push_back(kv.first);
|
||||||
sf.full_values.push_back(kv.second);
|
sf.full_values.push_back(kv.second);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (ssize_t i = (ssize_t) sf.full_keys.size() - 1; i >= 0; i--) {
|
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);
|
coerce_value(sf.full_keys[i], sf.full_values[i].type, sf.full_values[i].s, sst->attribute_types);
|
||||||
|
|||||||
+6315
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
#ifndef VERSION_HPP
|
#ifndef VERSION_HPP
|
||||||
#define VERSION_HPP
|
#define VERSION_HPP
|
||||||
|
|
||||||
#define VERSION "v2.28.0"
|
#define VERSION "v2.28.1"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user