Skip to content

Commit

Permalink
Fix tile counter
Browse files Browse the repository at this point in the history
  • Loading branch information
kleunen committed Feb 22, 2021
1 parent 6304130 commit 225031d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion include/osm_store.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ class OSMStore
return;
} catch(boost::interprocess::bad_alloc &e) {
map_size = map_size * 2;
std::cout << "Resizing osm store to size: " << map_size << std::endl;
std::cout << "Resizing osm store to size: " << (map_size / 1000000) << "M " << std::endl;

mmap_file = mmap_file_t();

Expand Down
8 changes: 4 additions & 4 deletions src/tilemaker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,10 @@ int main(int argc, char* argv[]) {
// Mutex is hold when IO is performed
std::mutex io_mutex;

for (uint zoom=sharedData.config.startZoom; zoom<=sharedData.config.endZoom; zoom++) {
// Loop through tiles
uint tc = 0;

// Loop through tiles
uint tc = 0;
for (uint zoom=sharedData.config.startZoom; zoom<=sharedData.config.endZoom; zoom++) {

for (TilesAtZoomIterator it = sharedData.tileData.at(zoom).GetTilesAtZoomBegin(); it != sharedData.tileData.at(zoom).GetTilesAtZoomEnd(); ++it) {
// If we're constrained to a source tile, check we're within it
Expand All @@ -321,7 +321,7 @@ int main(int argc, char* argv[]) {
outputProc(pool, sharedData, osmStore, it, zoom);

uint interval = 100;
if(tc % interval == 0) {
if(tc % interval == 0 || tc == total_tiles) {
const std::lock_guard<std::mutex> lock(io_mutex);
cout << "Zoom level " << zoom << ", writing tile " << tc << " of " << total_tiles << " \r";
}
Expand Down

0 comments on commit 225031d

Please sign in to comment.