mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-02 08:25:40 +02:00
Reduce attribute accumulation memory consumption (#318)
* Add a flag to use an H3 index for the feature index
* Give mvt_value and serial_val a double-with-count concept
* Switch mean over to internal accumulation state
* Get rid of the attribute accumulation map
* Change vectors of features to vectors of pointers to features
* Fix --coalesce
* Revert "Add a flag to use an H3 index for the feature index"
This reverts commit b9b48f42c9.
* Update version and changelog
This commit is contained in:
+14
-1
@@ -70,6 +70,20 @@ struct serial_val {
|
||||
type = mvt_string;
|
||||
s = val;
|
||||
}
|
||||
|
||||
size_t get_count() const {
|
||||
size_t found = s.find('\0');
|
||||
if (found == std::string::npos) {
|
||||
return 0;
|
||||
} else {
|
||||
return atoll(s.c_str() + found + 1);
|
||||
}
|
||||
}
|
||||
|
||||
void set_double_count(double v, size_t c) {
|
||||
type = mvt_double;
|
||||
s = milo::dtoa_milo(v) + '\0' + std::to_string(c);
|
||||
}
|
||||
};
|
||||
|
||||
struct key_pool {
|
||||
@@ -152,7 +166,6 @@ struct serial_feature {
|
||||
const char *stringpool; // string pool for keys/values lookup
|
||||
std::shared_ptr<std::string> tile_stringpool; // string pool for mvt_value construction
|
||||
std::set<std::string> need_tilestats;
|
||||
std::unordered_map<std::string, accum_state> attribute_accum_state;
|
||||
|
||||
int z; // tile being produced
|
||||
int tx;
|
||||
|
||||
Reference in New Issue
Block a user