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
+6 -5
View File
@@ -5,6 +5,7 @@
#include <math.h>
#include "memfile.hpp"
#include "pool.hpp"
#include "errors.hpp"
int swizzlecmp(const char *a, const char *b) {
ssize_t alen = strlen(a);
@@ -63,11 +64,11 @@ long long addpool(struct memfile *poolfile, struct memfile *treefile, const char
long long off = poolfile->off;
if (memfile_write(poolfile, &type, 1) < 0) {
perror("memfile write");
exit(EXIT_FAILURE);
exit(EXIT_WRITE);
}
if (memfile_write(poolfile, (void *) s, strlen(s) + 1) < 0) {
perror("memfile write");
exit(EXIT_FAILURE);
exit(EXIT_WRITE);
}
return off;
}
@@ -84,11 +85,11 @@ long long addpool(struct memfile *poolfile, struct memfile *treefile, const char
long long off = poolfile->off;
if (memfile_write(poolfile, &type, 1) < 0) {
perror("memfile write");
exit(EXIT_FAILURE);
exit(EXIT_WRITE);
}
if (memfile_write(poolfile, (void *) s, strlen(s) + 1) < 0) {
perror("memfile write");
exit(EXIT_FAILURE);
exit(EXIT_WRITE);
}
if (off >= LONG_MAX || treefile->off >= LONG_MAX) {
@@ -109,7 +110,7 @@ long long addpool(struct memfile *poolfile, struct memfile *treefile, const char
long long p = treefile->off;
if (memfile_write(treefile, &tsp, sizeof(struct stringpool)) < 0) {
perror("memfile write");
exit(EXIT_FAILURE);
exit(EXIT_WRITE);
}
if (ssp == -1) {