Factor out vector tile writing

This commit is contained in:
Eric Fischer
2016-04-22 15:06:26 -07:00
parent f902721dab
commit 358f019372
4 changed files with 172 additions and 91 deletions
+9
View File
@@ -96,6 +96,15 @@ void handle(std::string message, int z, unsigned x, unsigned y, int describe) {
printf(", ");
}
if (feat.tags[t] >= layer.keys.size()) {
fprintf(stderr, "Error: out of bounds feature key\n");
exit(EXIT_FAILURE);
}
if (feat.tags[t + 1] >= layer.values.size()) {
fprintf(stderr, "Error: out of bounds feature value\n");
exit(EXIT_FAILURE);
}
const char *key = layer.keys[feat.tags[t]].c_str();
pb_value const &val = layer.values[feat.tags[t + 1]];