Improve the appearance of coalesce-densest-as-needed tiles (#247)

* Start to distinguish fixed cluster density setting from as-needed density

* Make consistent {drop,coalesce}-densest decisions between zooms

* Actually track the previous index instead of just intending to

* Clean up collinearities in coalesced features

* To determine densest, look at actual physical distance, not just index

* Don't actually need the previous index in serial_feature now

* Center of mass of one feature to most distant point of the next

* Add apologetic comment

* Wait, how did the tests pass before?

* Revert "Wait, how did the tests pass before?"

This reverts commit f73c8ee543.

* Add --maximum-string-attribute-length option

* Update version and changelog

* A little more testing to make sure
This commit is contained in:
Erica Fischer
2024-07-16 13:23:23 -07:00
committed by GitHub
parent 939579e5a2
commit 47e774adc4
21 changed files with 3801 additions and 4006 deletions
+16
View File
@@ -325,3 +325,19 @@ unsigned long long bit_reverse(unsigned long long v) {
v = ((v & 0x5555555555555555) << 1) | ((v & 0xAAAAAAAAAAAAAAAA) >> 1);
return v;
}
std::string truncate_string(std::string const &s, size_t len) {
if (s.length() <= len) {
return s;
}
// find the initial byte of a UTF-8 character
ssize_t i;
for (i = len; i > 0; i--) {
if ((s[i] & 0x80) == 0 || (s[i] & 0xC0) == 0xC0) {
break;
}
}
return s.substr(0, i);
}