Exclude long attribute values from tilestats output, as specified

This commit is contained in:
Eric Fischer
2017-07-21 12:28:14 -07:00
parent 00aed42c0e
commit 62f135a97d
7 changed files with 87 additions and 12 deletions
+8 -3
View File
@@ -13,6 +13,7 @@
#include <map>
#include "mvt.hpp"
#include "mbtiles.hpp"
#include "text.hpp"
sqlite3 *mbtiles_open(char *dbname, char **argv, int forcetable) {
sqlite3 *outdb;
@@ -251,9 +252,13 @@ std::string tilestats(std::map<std::string, layermap_entry> const &layermap) {
out.append("\t\t\t\t\t\t");
out.append(value.string);
} else {
out.append("\t\t\t\t\t\t\"");
quote(&out, value.string.c_str());
out.append("\"");
std::string trunc = truncate16(value.string, 256);
if (trunc.size() == value.string.size()) {
out.append("\t\t\t\t\t\t\"");
quote(&out, value.string.c_str());
out.append("\"");
}
}
}