Merge pull request #417 from mapbox/only-warn-once

Only warn once about invalid polygon encoding in tippecanoe-decode
This commit is contained in:
Eric Fischer 2017-05-12 11:24:02 -07:00 committed by GitHub
commit 733092abf6
3 changed files with 23 additions and 7 deletions

View File

@ -1,3 +1,7 @@
## 1.18.1
* Only warn once about invalid polygons in tippecanoe-decode
## 1.18.0
* Fix compression of tiles in tile-join

View File

@ -271,10 +271,16 @@ void handle(std::string message, int z, unsigned x, unsigned y, int describe, st
if (i + 1 >= ops.size() || ops[i + 1].op == VT_MOVETO) {
if (ops[i].op != VT_CLOSEPATH) {
static bool warned = false;
if (!warned) {
fprintf(stderr, "Ring does not end with closepath (ends with %d)\n", ops[i].op);
if (!force) {
exit(EXIT_FAILURE);
}
warned = true;
}
}
}
}
@ -307,10 +313,16 @@ void handle(std::string message, int z, unsigned x, unsigned y, int describe, st
int state = 0;
for (size_t i = 0; i < rings.size(); i++) {
if (i == 0 && areas[i] < 0) {
static bool warned = false;
if (!warned) {
fprintf(stderr, "Polygon begins with an inner ring\n");
if (!force) {
exit(EXIT_FAILURE);
}
warned = true;
}
}
if (areas[i] >= 0) {

View File

@ -1 +1 @@
#define VERSION "tippecanoe v1.18.0\n"
#define VERSION "tippecanoe v1.18.1\n"