Skip to content

Commit

Permalink
Plumb the bins through to overzoom()
Browse files Browse the repository at this point in the history
  • Loading branch information
e-n-f committed Aug 21, 2024
1 parent f1112f6 commit f1e5e4f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
16 changes: 10 additions & 6 deletions clip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1022,8 +1022,10 @@ drawvec reduce_tiny_poly(drawvec const &geom, int z, int detail, bool *still_nee
std::string overzoom(std::vector<input_tile> const &tiles, int nz, int nx, int ny,
int detail, int buffer, std::set<std::string> const &keep, bool do_compress,
std::vector<std::pair<unsigned, unsigned>> *next_overzoomed_tiles,
bool demultiply, json_object *filter, bool preserve_input_order, std::unordered_map<std::string, attribute_op> const &attribute_accum, std::vector<std::string> const &unidecode_data, double simplification,
double tiny_polygon_size) {
bool demultiply, json_object *filter, bool preserve_input_order,
std::unordered_map<std::string, attribute_op> const &attribute_accum,
std::vector<std::string> const &unidecode_data, double simplification,
double tiny_polygon_size, std::vector<mvt_layer> const &bins) {
std::vector<source_tile> decoded;

for (auto const &t : tiles) {
Expand All @@ -1049,7 +1051,7 @@ std::string overzoom(std::vector<input_tile> const &tiles, int nz, int nx, int n
decoded.push_back(out);
}

return overzoom(decoded, nz, nx, ny, detail, buffer, keep, do_compress, next_overzoomed_tiles, demultiply, filter, preserve_input_order, attribute_accum, unidecode_data, simplification, tiny_polygon_size);
return overzoom(decoded, nz, nx, ny, detail, buffer, keep, do_compress, next_overzoomed_tiles, demultiply, filter, preserve_input_order, attribute_accum, unidecode_data, simplification, tiny_polygon_size, bins);
}

struct tile_feature {
Expand Down Expand Up @@ -1150,8 +1152,10 @@ static struct preservecmp {
std::string overzoom(std::vector<source_tile> const &tiles, int nz, int nx, int ny,
int detail, int buffer, std::set<std::string> const &keep, bool do_compress,
std::vector<std::pair<unsigned, unsigned>> *next_overzoomed_tiles,
bool demultiply, json_object *filter, bool preserve_input_order, std::unordered_map<std::string, attribute_op> const &attribute_accum, std::vector<std::string> const &unidecode_data, double simplification,
double tiny_polygon_size) {
bool demultiply, json_object *filter, bool preserve_input_order,
std::unordered_map<std::string, attribute_op> const &attribute_accum,
std::vector<std::string> const &unidecode_data, double simplification,
double tiny_polygon_size, std::vector<mvt_layer> const &bins) {
mvt_tile outtile;
std::shared_ptr<std::string> tile_stringpool = std::make_shared<std::string>();

Expand Down Expand Up @@ -1367,7 +1371,7 @@ std::string overzoom(std::vector<source_tile> const &tiles, int nz, int nx, int
std::string child = overzoom(sts,
nz + 1, nx * 2 + x, ny * 2 + y,
detail, buffer, keep, false, NULL,
demultiply, filter, preserve_input_order, attribute_accum, unidecode_data, simplification, tiny_polygon_size);
demultiply, filter, preserve_input_order, attribute_accum, unidecode_data, simplification, tiny_polygon_size, bins);
if (child.size() > 0) {
next_overzoomed_tiles->emplace_back(nx * 2 + x, ny * 2 + y);
}
Expand Down
4 changes: 2 additions & 2 deletions geometry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,15 @@ std::string overzoom(std::vector<source_tile> const &tiles, int nz, int nx, int
bool demultiply, json_object *filter, bool preserve_input_order,
std::unordered_map<std::string, attribute_op> const &attribute_accum,
std::vector<std::string> const &unidecode_data, double simplification,
double tiny_polygon_size);
double tiny_polygon_size, std::vector<mvt_layer> const &bins);

std::string overzoom(std::vector<input_tile> const &tiles, int nz, int nx, int ny,
int detail, int buffer, std::set<std::string> const &keep, bool do_compress,
std::vector<std::pair<unsigned, unsigned>> *next_overzoomed_tiles,
bool demultiply, json_object *filter, bool preserve_input_order,
std::unordered_map<std::string, attribute_op> const &attribute_accum,
std::vector<std::string> const &unidecode_data, double simplification,
double tiny_polygon_size);
double tiny_polygon_size, std::vector<mvt_layer> const &bins);

draw center_of_mass_mp(const drawvec &dv);

Expand Down
2 changes: 1 addition & 1 deletion overzoom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ int main(int argc, char **argv) {
its.push_back(std::move(t));
}

std::string out = overzoom(its, nz, nx, ny, detail, buffer, keep, true, NULL, demultiply, json_filter, preserve_input_order, attribute_accum, unidecode_data, simplification, tiny_polygon_size);
std::string out = overzoom(its, nz, nx, ny, detail, buffer, keep, true, NULL, demultiply, json_filter, preserve_input_order, attribute_accum, unidecode_data, simplification, tiny_polygon_size, bins);

FILE *f = fopen(outfile, "wb");
if (f == NULL) {
Expand Down
2 changes: 1 addition & 1 deletion tile-join.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ struct tileset_reader {
t.y = parent_tile.y;
tv.push_back(std::move(t));

std::string ret = overzoom(tv, tile.z, tile.x, tile.y, -1, buffer, std::set<std::string>(), false, &next_overzoomed_tiles, false, NULL, false, std::unordered_map<std::string, attribute_op>(), unidecode_data, 0, 0);
std::string ret = overzoom(tv, tile.z, tile.x, tile.y, -1, buffer, std::set<std::string>(), false, &next_overzoomed_tiles, false, NULL, false, std::unordered_map<std::string, attribute_op>(), unidecode_data, 0, 0, std::vector<mvt_layer>());
return ret;
}

Expand Down

0 comments on commit f1e5e4f

Please sign in to comment.