Choose the center of the busiest tile for the map center

This commit is contained in:
Eric Fischer
2014-09-24 12:14:35 -07:00
parent fbf60b6d80
commit ce3cdfc5e9
3 changed files with 22 additions and 7 deletions
+5 -1
View File
@@ -204,7 +204,7 @@ int remove_noop(struct draw *geom, int n) {
return out;
}
void write_tile(struct index *start, struct index *end, char *metabase, unsigned *file_bbox, int z, unsigned tx, unsigned ty, int detail, int basezoom, struct pool *file_keys) {
long long write_tile(struct index *start, struct index *end, char *metabase, unsigned *file_bbox, int z, unsigned tx, unsigned ty, int detail, int basezoom, struct pool *file_keys) {
GOOGLE_PROTOBUF_VERIFY_VERSION;
mapnik::vector::tile tile;
@@ -235,6 +235,7 @@ void write_tile(struct index *start, struct index *end, char *metabase, unsigned
double interval = 1;
double seq = 0;
long long count = 0;
if (z < basezoom) {
interval = exp(log(2.5) * (basezoom - z));
@@ -288,6 +289,7 @@ void write_tile(struct index *start, struct index *end, char *metabase, unsigned
}
draw(geom, len, feature);
count += len;
int m;
deserialize_int(&meta, &m);
@@ -351,5 +353,7 @@ void write_tile(struct index *start, struct index *end, char *metabase, unsigned
FILE *f = fopen(path, "wb");
fwrite(compressed.data(), 1, compressed.size(), f);
fclose(f);
return count;
}