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
+7 -6
View File
@@ -9,6 +9,7 @@
#include "csv.hpp"
#include "milo/dtoa_milo.h"
#include "options.hpp"
#include "errors.hpp"
void parse_geocsv(std::vector<struct serialization_state> &sst, std::string fname, int layer, std::string layername) {
FILE *f;
@@ -19,7 +20,7 @@ void parse_geocsv(std::vector<struct serialization_state> &sst, std::string fnam
f = fopen(fname.c_str(), "r");
if (f == NULL) {
perror(fname.c_str());
exit(EXIT_FAILURE);
exit(EXIT_OPEN);
}
}
@@ -31,7 +32,7 @@ void parse_geocsv(std::vector<struct serialization_state> &sst, std::string fnam
std::string err = check_utf8(s);
if (err != "") {
fprintf(stderr, "%s: %s\n", fname.c_str(), err.c_str());
exit(EXIT_FAILURE);
exit(EXIT_UTF8);
}
header = csv_split(s.c_str());
@@ -53,7 +54,7 @@ void parse_geocsv(std::vector<struct serialization_state> &sst, std::string fnam
if (latcol < 0 || loncol < 0) {
fprintf(stderr, "%s: Can't find \"lat\" and \"lon\" columns\n", fname.c_str());
exit(EXIT_FAILURE);
exit(EXIT_CSV);
}
size_t seq = 0;
@@ -61,7 +62,7 @@ void parse_geocsv(std::vector<struct serialization_state> &sst, std::string fnam
std::string err = check_utf8(s);
if (err != "") {
fprintf(stderr, "%s: %s\n", fname.c_str(), err.c_str());
exit(EXIT_FAILURE);
exit(EXIT_UTF8);
}
seq++;
@@ -69,7 +70,7 @@ void parse_geocsv(std::vector<struct serialization_state> &sst, std::string fnam
if (line.size() != header.size()) {
fprintf(stderr, "%s:%zu: Mismatched column count: %zu in line, %zu in header\n", fname.c_str(), seq + 1, line.size(), header.size());
exit(EXIT_FAILURE);
exit(EXIT_CSV);
}
if (line[loncol].empty() || line[latcol].empty()) {
@@ -133,7 +134,7 @@ void parse_geocsv(std::vector<struct serialization_state> &sst, std::string fnam
if (fname.size() != 0) {
if (fclose(f) != 0) {
perror("fclose");
exit(EXIT_FAILURE);
exit(EXIT_CLOSE);
}
}
}