Compare commits

..
8 changed files with 9 additions and 57 deletions
-4
View File
@@ -1,7 +1,3 @@
# 2.72.0
* Add --clip-polygon-file and --feature-filter-file options to tippecanoe-overzoom
# 2.71.0
* Add --clip-bounding-box and --clip-polygon options to tippecanoe-overzoom
-10
View File
@@ -326,11 +326,6 @@ overzoom-test: tippecanoe-overzoom
./tippecanoe-decode tests/pbf/0-0-0-pop-expr.pbf 0 0 0 > tests/pbf/0-0-0-pop-expr.pbf.json.check
cmp tests/pbf/0-0-0-pop-expr.pbf.json.check tests/pbf/0-0-0-pop-expr.pbf.json
rm tests/pbf/0-0-0-pop-expr.pbf tests/pbf/0-0-0-pop-expr.pbf.json.check
# Same filter test, but reading the filter from a file
./tippecanoe-overzoom -y NAME -J tests/pbf/scalerank-0-filter.json -o tests/pbf/0-0-0-pop-expr.pbf tests/pbf/0-0-0-pop.pbf 0/0/0 0/0/0
./tippecanoe-decode tests/pbf/0-0-0-pop-expr.pbf 0 0 0 > tests/pbf/0-0-0-pop-expr.pbf.json.check
cmp tests/pbf/0-0-0-pop-expr.pbf.json.check tests/pbf/0-0-0-pop-expr.pbf.json
rm tests/pbf/0-0-0-pop-expr.pbf tests/pbf/0-0-0-pop-expr.pbf.json.check
# Filtering with multiplier
# 243 features in the source tile tests/pbf/0-0-0-pop.pbf
# 8 features survive into the output, from 9 clusters of 30
@@ -387,11 +382,6 @@ overzoom-test: tippecanoe-overzoom
./tippecanoe-decode tests/pbf/bin-11-327-791-ids-clip.pbf.out 11 327 791 > tests/pbf/bin-11-327-791-ids-clip.pbf.out.json.check
cmp tests/pbf/bin-11-327-791-ids-clip.pbf.out.json.check tests/pbf/bin-11-327-791-ids-clip.pbf.out.json
rm tests/pbf/bin-11-327-791-ids-clip.pbf.out.json.check tests/pbf/bin-11-327-791-ids-clip.pbf.out
# Binning by id, clipping by polygon from file
./tippecanoe-overzoom -o tests/pbf/bin-11-327-791-ids-clip.pbf.out --clip-polygon-file=tests/pbf/clip-poly.json --assign-to-bins tests/pbf/sf-zips.json --bin-by-id-list bin-ids tests/pbf/yearbuilt.pbf 11/327/791 11/327/791
./tippecanoe-decode tests/pbf/bin-11-327-791-ids-clip.pbf.out 11 327 791 > tests/pbf/bin-11-327-791-ids-clip.pbf.out.json.check
cmp tests/pbf/bin-11-327-791-ids-clip.pbf.out.json.check tests/pbf/bin-11-327-791-ids-clip.pbf.out.json
rm tests/pbf/bin-11-327-791-ids-clip.pbf.out.json.check tests/pbf/bin-11-327-791-ids-clip.pbf.out
# Binning by id, attribute stripping
# Note that it still works even if we exclude the ID that we are binning by
./tippecanoe-overzoom -yZCTA5CE10 -ytippecanoe:count -o tests/pbf/bin-11-327-791-ids-zip.pbf.out --assign-to-bins tests/pbf/sf-zips.json --bin-by-id-list bin-ids tests/pbf/yearbuilt.pbf 11/327/791 11/327/791
+7 -7
View File
@@ -34,7 +34,7 @@ static std::string mvt_value_to_string(mvt_value const &one, bool &fail, std::ve
return "";
case mvt_no_such_key:
default:
fprintf(stderr, "unhandled mvt_type %d\n", one.type);
fprintf(stderr, "unhandled mvt_type %d (%s)\n", one.type, one.toString().c_str());
exit(EXIT_IMPOSSIBLE);
}
}
@@ -107,7 +107,7 @@ int compare_fsl(mvt_value const &one, json_object *two, bool &fail, std::vector<
fail = true; // null op number => null
return 0;
default:
fprintf(stderr, "unhandled mvt_type %d\n", one.type);
fprintf(stderr, "unhandled mvt_type %d comparing %s to %s\n", one.type, one.toString().c_str(), json_stringify(two));
exit(EXIT_IMPOSSIBLE);
}
@@ -161,7 +161,7 @@ int compare_fsl(mvt_value const &one, json_object *two, bool &fail, std::vector<
case mvt_no_such_key:
default:
fprintf(stderr, "unhandled mvt_type %d\n", one.type);
fprintf(stderr, "unhandled mvt_type %d comparing %s to %s\n", one.type, one.toString().c_str(), json_stringify(two));
exit(EXIT_IMPOSSIBLE);
}
@@ -169,7 +169,7 @@ int compare_fsl(mvt_value const &one, json_object *two, bool &fail, std::vector<
return lhs - rhs;
}
fprintf(stderr, "unhandled JSON type %d\n", two->type);
fprintf(stderr, "unhandled JSON type %d comparing %s to %s\n", two->type, one.toString().c_str(), json_stringify(two));
exit(EXIT_IMPOSSIBLE);
}
@@ -212,7 +212,7 @@ int compare(mvt_value const &one, json_object *two, bool &fail) {
break;
case mvt_no_such_key:
default:
fprintf(stderr, "Internal error: bad mvt type %d\n", one.type);
fprintf(stderr, "Internal error: bad mvt type %d (%s)\n", one.type, one.toString().c_str());
exit(EXIT_IMPOSSIBLE);
}
@@ -248,7 +248,7 @@ int compare(mvt_value const &one, json_object *two, bool &fail) {
break;
}
fprintf(stderr, "Internal error: bad mvt type %d\n", one.type);
fprintf(stderr, "Internal error: bad mvt type %d (%s)\n", one.type, one.toString().c_str());
exit(EXIT_IMPOSSIBLE);
}
@@ -445,7 +445,7 @@ static int eval(std::function<mvt_value(std::string const &)> feature, json_obje
return cmp <= 0;
}
fprintf(stderr, "expression fsl comparison: can't happen %s\n", f->value.array.array[1]->value.string.string);
fprintf(stderr, "expression fsl comparison: can't happen %s (%s)\n", f->value.array.array[1]->value.string.string, json_stringify(f));
exit(EXIT_IMPOSSIBLE);
}
+1 -1
View File
@@ -700,7 +700,7 @@ metadata make_metadata(const char *fname, int minzoom, int maxzoom, double minla
m.strategies_json = stringify_strategies(strategies);
if (std::isinf(droprate)) {
if (isinf(droprate)) {
droprate = LLONG_MAX;
}
if (basezoom != maxzoom || droprate != 2.5 || retain_points_multiplier != 1) {
-32
View File
@@ -40,26 +40,6 @@ void usage(char **argv) {
exit(EXIT_FAILURE);
}
std::string read_json_file(const char *fname) {
std::string out;
FILE *f = fopen(fname, "r");
if (f == NULL) {
perror(optarg);
exit(EXIT_OPEN);
}
char buf[2000];
size_t nread;
while ((nread = fread(buf, sizeof(char), 2000, f)) != 0) {
out += std::string(buf, nread);
}
fclose(f);
return out;
}
int main(int argc, char **argv) {
int i;
const char *outtile = NULL;
@@ -80,7 +60,6 @@ int main(int argc, char **argv) {
{"output", required_argument, 0, 'o'},
{"filter-points-multiplier", no_argument, 0, 'm'},
{"feature-filter", required_argument, 0, 'j'},
{"feature-filter-file", required_argument, 0, 'J'},
{"preserve-input-order", no_argument, 0, 'o' & 0x1F},
{"accumulate-attribute", required_argument, 0, 'E'},
{"unidecode-data", required_argument, 0, 'u' & 0x1F},
@@ -93,7 +72,6 @@ int main(int argc, char **argv) {
{"no-tile-compression", no_argument, 0, 'd' & 0x1F},
{"clip-bounding-box", required_argument, 0, 'k' & 0x1F},
{"clip-polygon", required_argument, 0, 'l' & 0x1F},
{"clip-polygon-file", required_argument, 0, 'm' & 0x1F},
{0, 0, 0, 0},
};
@@ -144,10 +122,6 @@ int main(int argc, char **argv) {
filter = optarg;
break;
case 'J':
filter = read_json_file(optarg);
break;
case 'o' & 0x1F:
preserve_input_order = true;
break;
@@ -207,12 +181,6 @@ int main(int argc, char **argv) {
break;
}
case 'm' & 0x1F: {
clipbbox clip = parse_clip_poly(read_json_file(optarg));
clipbboxes.push_back(clip);
break;
}
default:
fprintf(stderr, "Unrecognized flag -%c\n", i);
usage(argv);
-1
View File
@@ -1 +0,0 @@
{"coordinates":[[[-122.4527379,37.8128815],[-122.4598853,37.7834743],[-122.4280914,37.7959397],[-122.4527379,37.8128815]]],"type":"Polygon"}
-1
View File
@@ -1 +0,0 @@
{"*":["SCALERANK","eq",0]}
+1 -1
View File
@@ -1,6 +1,6 @@
#ifndef VERSION_HPP
#define VERSION_HPP
#define VERSION "v2.72.0"
#define VERSION "v2.71.0"
#endif