diff --git a/overzoom.cpp b/overzoom.cpp index 8eb96268..5e3dc47c 100644 --- a/overzoom.cpp +++ b/overzoom.cpp @@ -9,6 +9,7 @@ #include "evaluator.hpp" #include "attribute.hpp" #include "text.hpp" +#include "read_json.hpp" extern char *optarg; extern int optind; @@ -20,7 +21,7 @@ std::string filter; bool preserve_input_order = false; std::unordered_map attribute_accum; std::vector unidecode_data; -std::string assign_to_bins; +std::vector bins; std::set keep; @@ -38,6 +39,7 @@ int main(int argc, char **argv) { const char *outfile = NULL; double simplification = 0; double tiny_polygon_size = 0; + std::string assign_to_bins; std::vector sources; @@ -134,9 +136,6 @@ int main(int argc, char **argv) { std::vector its; int nz, nx, ny; - if (assign_to_bins.size() != 0) { - } - if (outtile == NULL) { // single input if (argc - optind != 3) { fprintf(stderr, "Wrong number of arguments\n"); @@ -191,6 +190,17 @@ int main(int argc, char **argv) { } } + if (assign_to_bins.size() != 0) { + FILE *f = fopen(assign_to_bins.c_str(), "r"); + if (f == NULL) { + perror(assign_to_bins.c_str()); + exit(EXIT_OPEN); + } + + bins = parse_layers(f, nz, nx, ny, 1LL << detail); + fclose(f); + } + json_object *json_filter = NULL; if (filter.size() > 0) { json_filter = parse_filter(filter.c_str());