Forgot this other place where final geometry can be written out

This commit is contained in:
Eric Fischer
2016-10-11 12:42:20 -07:00
parent d381f5a9e1
commit 08310d9564
+21 -14
View File
@@ -219,20 +219,8 @@ struct drop_state {
long long included; long long included;
}; };
static void merge(struct mergelist *merges, int nmerges, unsigned char *map, FILE *f, int bytes, long long nrec, char *geom_map, FILE *geom_out, long long *geompos, long long *progress, long long *progress_max, long long *progress_reported, int maxzoom, int basezoom, double droprate, double gamma, struct drop_state *ds) { int calc_feature_minzoom(struct index *ix, struct drop_state *ds, int maxzoom, int basezoom, double droprate, double gamma) {
struct mergelist *head = NULL; int feature_minzoom = 0;
for (size_t i = 0; i < nmerges; i++) {
if (merges[i].start < merges[i].end) {
insert(&(merges[i]), &head, map);
}
}
while (head != NULL) {
struct index *ix = (struct index *) (map + head->start);
fwrite_check(geom_map + ix->start, 1, ix->end - ix->start, geom_out, "merge geometry");
*geompos += ix->end - ix->start;
double feature_minzoom = 0;
if (gamma >= 0 && (ix->t == VT_POINT || if (gamma >= 0 && (ix->t == VT_POINT ||
(additional[A_LINE_DROP] && ix->t == VT_LINE) || (additional[A_LINE_DROP] && ix->t == VT_LINE) ||
@@ -253,6 +241,23 @@ static void merge(struct mergelist *merges, int nmerges, unsigned char *map, FIL
// XXX manage_gap // XXX manage_gap
} }
return feature_minzoom;
}
static void merge(struct mergelist *merges, int nmerges, unsigned char *map, FILE *f, int bytes, long long nrec, char *geom_map, FILE *geom_out, long long *geompos, long long *progress, long long *progress_max, long long *progress_reported, int maxzoom, int basezoom, double droprate, double gamma, struct drop_state *ds) {
struct mergelist *head = NULL;
for (size_t i = 0; i < nmerges; i++) {
if (merges[i].start < merges[i].end) {
insert(&(merges[i]), &head, map);
}
}
while (head != NULL) {
struct index *ix = (struct index *) (map + head->start);
fwrite_check(geom_map + ix->start, 1, ix->end - ix->start, geom_out, "merge geometry");
*geompos += ix->end - ix->start;
double feature_minzoom = calc_feature_minzoom(ix, ds, maxzoom, basezoom, droprate, gamma);
serialize_byte(geom_out, feature_minzoom, geompos, "merge geometry"); serialize_byte(geom_out, feature_minzoom, geompos, "merge geometry");
// Count this as an 75%-accomplishment, since we already 25%-counted it // Count this as an 75%-accomplishment, since we already 25%-counted it
@@ -761,6 +766,8 @@ void radix1(int *geomfds_in, int *indexfds_in, int inputs, int prefix, int split
fwrite_check(geommap + ix.start, ix.end - ix.start, 1, geomfile, "geom"); fwrite_check(geommap + ix.start, ix.end - ix.start, 1, geomfile, "geom");
*geompos_out += ix.end - ix.start; *geompos_out += ix.end - ix.start;
double feature_minzoom = calc_feature_minzoom(&ix, ds, maxzoom, basezoom, droprate, gamma);
serialize_byte(geomfile, feature_minzoom, geompos_out, "merge geometry");
// Count this as an 75%-accomplishment, since we already 25%-counted it // Count this as an 75%-accomplishment, since we already 25%-counted it
*progress += (ix.end - ix.start) * 3 / 4; *progress += (ix.end - ix.start) * 3 / 4;