Merge pull request #656 from mapbox/tile-join-maxzoom

Warn in tile-join if tilesets being joined have different maxzooms
This commit is contained in:
Eric Fischer 2018-10-31 16:09:11 -07:00 committed by GitHub
commit b8ffdda32e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 2 deletions

View File

@ -1,3 +1,7 @@
## 1.32.2
* Warn in tile-join if tilesets being joined have inconsistent maxzooms
## 1.32.1
* Fix null pointer crash when reading filter output that does not

View File

@ -363,6 +363,7 @@ struct reader {
std::vector<zxy> dirtiles;
std::string dirbase;
std::string name;
sqlite3 *db = NULL;
sqlite3_stmt *stmt = NULL;
@ -400,8 +401,9 @@ struct reader {
struct reader *begin_reading(char *fname) {
struct reader *r = new reader;
struct stat st;
r->name = fname;
struct stat st;
if (stat(fname, &st) == 0 && (st.st_mode & S_IFDIR) != 0) {
r->db = NULL;
r->stmt = NULL;
@ -735,6 +737,11 @@ void decode(struct reader *readers, std::map<std::string, layermap_entry> &layer
if (sqlite3_prepare_v2(db, "SELECT value from metadata where name = 'maxzoom'", -1, &r->stmt, NULL) == SQLITE_OK) {
if (sqlite3_step(r->stmt) == SQLITE_ROW) {
int maxz = min(sqlite3_column_int(r->stmt, 0), maxzoom);
if (st->maxzoom >= 0 && maxz != st->maxzoom) {
fprintf(stderr, "Warning: mismatched maxzooms: %d in %s vs previous %d\n", maxz, r->name.c_str(), st->maxzoom);
}
st->maxzoom = max(st->maxzoom, maxz);
}
sqlite3_finalize(r->stmt);

View File

@ -1,6 +1,6 @@
#ifndef VERSION_HPP
#define VERSION_HPP
#define VERSION "v1.32.1"
#define VERSION "v1.32.2"
#endif