mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-02 08:25:40 +02:00
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:
@@ -1,5 +1,6 @@
|
||||
#include "csv.hpp"
|
||||
#include "text.hpp"
|
||||
#include "errors.hpp"
|
||||
|
||||
std::vector<std::string> csv_split(const char *s) {
|
||||
std::vector<std::string> ret;
|
||||
@@ -68,7 +69,7 @@ void readcsv(const char *fn, std::vector<std::string> &header, std::map<std::str
|
||||
FILE *f = fopen(fn, "r");
|
||||
if (f == NULL) {
|
||||
perror(fn);
|
||||
exit(EXIT_FAILURE);
|
||||
exit(EXIT_OPEN);
|
||||
}
|
||||
|
||||
std::string s;
|
||||
@@ -76,7 +77,7 @@ void readcsv(const char *fn, std::vector<std::string> &header, std::map<std::str
|
||||
std::string err = check_utf8(s);
|
||||
if (err != "") {
|
||||
fprintf(stderr, "%s: %s\n", fn, err.c_str());
|
||||
exit(EXIT_FAILURE);
|
||||
exit(EXIT_UTF8);
|
||||
}
|
||||
|
||||
header = csv_split(s.c_str());
|
||||
@@ -89,7 +90,7 @@ void readcsv(const char *fn, std::vector<std::string> &header, std::map<std::str
|
||||
std::string err = check_utf8(s);
|
||||
if (err != "") {
|
||||
fprintf(stderr, "%s: %s\n", fn, err.c_str());
|
||||
exit(EXIT_FAILURE);
|
||||
exit(EXIT_UTF8);
|
||||
}
|
||||
|
||||
std::vector<std::string> line = csv_split(s.c_str());
|
||||
@@ -105,7 +106,7 @@ void readcsv(const char *fn, std::vector<std::string> &header, std::map<std::str
|
||||
|
||||
if (fclose(f) != 0) {
|
||||
perror("fclose");
|
||||
exit(EXIT_FAILURE);
|
||||
exit(EXIT_CLOSE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user