mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-06 18:35:41 +02:00
Read the file of bins
This commit is contained in:
+14
-4
@@ -9,6 +9,7 @@
|
|||||||
#include "evaluator.hpp"
|
#include "evaluator.hpp"
|
||||||
#include "attribute.hpp"
|
#include "attribute.hpp"
|
||||||
#include "text.hpp"
|
#include "text.hpp"
|
||||||
|
#include "read_json.hpp"
|
||||||
|
|
||||||
extern char *optarg;
|
extern char *optarg;
|
||||||
extern int optind;
|
extern int optind;
|
||||||
@@ -20,7 +21,7 @@ std::string filter;
|
|||||||
bool preserve_input_order = false;
|
bool preserve_input_order = false;
|
||||||
std::unordered_map<std::string, attribute_op> attribute_accum;
|
std::unordered_map<std::string, attribute_op> attribute_accum;
|
||||||
std::vector<std::string> unidecode_data;
|
std::vector<std::string> unidecode_data;
|
||||||
std::string assign_to_bins;
|
std::vector<mvt_layer> bins;
|
||||||
|
|
||||||
std::set<std::string> keep;
|
std::set<std::string> keep;
|
||||||
|
|
||||||
@@ -38,6 +39,7 @@ int main(int argc, char **argv) {
|
|||||||
const char *outfile = NULL;
|
const char *outfile = NULL;
|
||||||
double simplification = 0;
|
double simplification = 0;
|
||||||
double tiny_polygon_size = 0;
|
double tiny_polygon_size = 0;
|
||||||
|
std::string assign_to_bins;
|
||||||
|
|
||||||
std::vector<input_tile> sources;
|
std::vector<input_tile> sources;
|
||||||
|
|
||||||
@@ -134,9 +136,6 @@ int main(int argc, char **argv) {
|
|||||||
std::vector<input_tile> its;
|
std::vector<input_tile> its;
|
||||||
int nz, nx, ny;
|
int nz, nx, ny;
|
||||||
|
|
||||||
if (assign_to_bins.size() != 0) {
|
|
||||||
}
|
|
||||||
|
|
||||||
if (outtile == NULL) { // single input
|
if (outtile == NULL) { // single input
|
||||||
if (argc - optind != 3) {
|
if (argc - optind != 3) {
|
||||||
fprintf(stderr, "Wrong number of arguments\n");
|
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;
|
json_object *json_filter = NULL;
|
||||||
if (filter.size() > 0) {
|
if (filter.size() > 0) {
|
||||||
json_filter = parse_filter(filter.c_str());
|
json_filter = parse_filter(filter.c_str());
|
||||||
|
|||||||
Reference in New Issue
Block a user