From f0a8e5b1920f4095cf64575e87ac93743cffd23f Mon Sep 17 00:00:00 2001 From: Eric Fischer Date: Fri, 6 Mar 2015 15:32:52 -0800 Subject: [PATCH] Progress indicator for reordering geometry --- geojson.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/geojson.c b/geojson.c index 37e16a2..4acb77c 100644 --- a/geojson.c +++ b/geojson.c @@ -782,9 +782,16 @@ void read_json(FILE *f, const char *fname, const char *layername, int maxzoom, i long long i; long long sum = 0; + long long progress = 0; for (i = 0; i < indexpos / sizeof(struct index); i++) { fwrite_check(geom_map + index_map[i].start, sizeof(char), index_map[i].end - index_map[i].start, geomfile, fname, jp); sum += index_map[i].end - index_map[i].start; + + long long p = 1000 * i / (indexpos / sizeof(struct index)); + if (p != progress) { + fprintf(stderr, "Reordering geometry: %3.1f%%\r", p / 10.0); + progress = p; + } } /* end of tile */