Pull from the back of the list of tiles to overzoom, not the front (#149)

This commit is contained in:
Erica Fischer
2023-10-04 14:59:19 -07:00
committed by GitHub
parent cc5c1c79df
commit 0ca14086a9
3 changed files with 12 additions and 7 deletions
+4
View File
@@ -1,3 +1,7 @@
# 2.34.1
* Further improvements to tile-join speed
# 2.34.0 # 2.34.0
* Improve speed of overzooming in tile-join * Improve speed of overzooming in tile-join
+7 -6
View File
@@ -380,13 +380,14 @@ double max(double a, double b) {
struct tilecmp { struct tilecmp {
bool operator()(std::pair<unsigned, unsigned> const &a, std::pair<unsigned, unsigned> const &b) { bool operator()(std::pair<unsigned, unsigned> const &a, std::pair<unsigned, unsigned> const &b) {
// must match behavior of tileset_reader::operator<() // must match behavior of tileset_reader::operator<()
// except backwards, since we are pulling from the end of the list
if (a.first < b.first) { if (b.first < a.first) {
return true; return true;
} }
if (a.first == b.first) { if (b.first == a.first) {
// Y sorts backwards, in TMS order // Y sorts backwards, in TMS order
if (a.second > b.second) { if (b.second > a.second) {
return true; return true;
} }
} }
@@ -555,8 +556,8 @@ struct tileset_reader {
return; return;
} }
auto xy = overzoomed_tiles.front(); auto xy = overzoomed_tiles.back();
overzoomed_tiles.erase(overzoomed_tiles.begin()); overzoomed_tiles.erase(overzoomed_tiles.begin() + overzoomed_tiles.size() - 1);
x = xy.first; x = xy.first;
y = xy.second; y = xy.second;
@@ -1061,7 +1062,7 @@ void decode(struct tileset_reader *readers, std::map<std::string, layermap_entry
// Then this tile is done and we can safely run the output queue. // Then this tile is done and we can safely run the output queue.
if (readers == NULL || readers->zoom != current.first.z || readers->x != current.first.x || readers->y != current.first.y) { if (readers == NULL || readers->zoom != current.first.z || readers->x != current.first.x || readers->y != current.first.y) {
if (tasks.size() > 10 * CPUS) { if (tasks.size() > 100 * CPUS) {
dispatch_tasks(tasks, layermaps, outdb, outdir, header, mapping, exclude, include, ifmatched, keep_layers, remove_layers, filter, readers); dispatch_tasks(tasks, layermaps, outdb, outdir, header, mapping, exclude, include, ifmatched, keep_layers, remove_layers, filter, readers);
tasks.clear(); tasks.clear();
} }
+1 -1
View File
@@ -1,6 +1,6 @@
#ifndef VERSION_HPP #ifndef VERSION_HPP
#define VERSION_HPP #define VERSION_HPP
#define VERSION "v2.34.0" #define VERSION "v2.34.1"
#endif #endif