Skip to content

Commit

Permalink
Merge branch 'main' into overzoom
Browse files Browse the repository at this point in the history
  • Loading branch information
e-n-f committed Jul 31, 2023
2 parents ae07c45 + 5cba919 commit 75e908c
Show file tree
Hide file tree
Showing 5 changed files with 6,334 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 2.28.1

* Allow --set-attribute to override an existing attribute value

# 2.28.0

* Add --preserve-point-density-threshold option to reduce blank areas of the map at low zooms
Expand Down
1 change: 1 addition & 0 deletions memfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <string.h>
#include <unistd.h>
#include <sys/mman.h>
#include <errno.h>
#include "memfile.hpp"

#define INCREMENT 131072
Expand Down
15 changes: 13 additions & 2 deletions serial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -630,8 +630,19 @@ int serialize_feature(struct serialization_state *sst, serial_feature &sf) {
}

for (auto &kv : set_attributes) {
sf.full_keys.push_back(kv.first);
sf.full_values.push_back(kv.second);
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_values.push_back(kv.second);
}
}

for (ssize_t i = (ssize_t) sf.full_keys.size() - 1; i >= 0; i--) {
Expand Down
Loading

0 comments on commit 75e908c

Please sign in to comment.