Once features can't possibly fit in a tile, stop trying (#9)

* Stop adding features to a tile if it can't possibly work

* Add --integer and --fraction options to tippecanoe-decode

* Carry the strategies field from tileset metadata through tile-join

* Update changelog

* Assign different codes to different kinds of error exits
This commit is contained in:
Erica Fischer
2022-09-23 20:01:13 -04:00
committed by GitHub
parent ed31b9ac84
commit af1a7ed7ae
44 changed files with 782 additions and 488 deletions
+3 -2
View File
@@ -5,6 +5,7 @@
#include <string.h>
#include "milo/dtoa_milo.h"
#include "milo/milo.h"
#include "errors.hpp"
/**
* Returns an empty string if `s` is valid utf8;
@@ -132,7 +133,7 @@ int integer_zoom(std::string where, std::string text) {
double d = atof(text.c_str());
if (!isfinite(d) || d != floor(d) || d < 0 || d > 32) {
fprintf(stderr, "%s: Expected integer zoom level in \"tippecanoe\" GeoJSON extension, not %s\n", where.c_str(), text.c_str());
exit(EXIT_FAILURE);
exit(EXIT_JSON);
}
return d;
}
@@ -179,7 +180,7 @@ char *dtoa_milo(double val) {
char *dup = strdup(s.c_str());
if (dup == NULL) {
perror("strdup");
exit(EXIT_FAILURE);
exit(EXIT_MEMORY);
}
return dup;
}