mirror of
https://github.com/mapbox/tippecanoe.git
synced 2025-01-22 04:18:01 +00:00
Don't write out tiles that have no features.
This commit is contained in:
parent
18647d18dd
commit
3a94106283
@ -95,6 +95,7 @@ void handle(std::string message, int z, unsigned x, unsigned y, struct pool **fi
|
||||
// https://github.com/mapbox/mapnik-vector-tile/blob/master/examples/c%2B%2B/tileinfo.cpp
|
||||
mapnik::vector::tile tile;
|
||||
mapnik::vector::tile outtile;
|
||||
int features_added = 0;
|
||||
|
||||
if (is_compressed(message)) {
|
||||
std::string uncompressed;
|
||||
@ -278,6 +279,8 @@ void handle(std::string message, int z, unsigned x, unsigned y, struct pool **fi
|
||||
for (unsigned i = 0; i < feature_tags.size(); i++) {
|
||||
outfeature->add_tags(feature_tags[i]);
|
||||
}
|
||||
|
||||
features_added++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -301,6 +304,10 @@ void handle(std::string message, int z, unsigned x, unsigned y, struct pool **fi
|
||||
pool_free_strings(&values);
|
||||
}
|
||||
|
||||
if (features_added == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::string s;
|
||||
std::string compressed;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user