mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-05 18:05:42 +02:00
Don't write out tiles that have no features.
This commit is contained in:
@@ -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
|
// https://github.com/mapbox/mapnik-vector-tile/blob/master/examples/c%2B%2B/tileinfo.cpp
|
||||||
mapnik::vector::tile tile;
|
mapnik::vector::tile tile;
|
||||||
mapnik::vector::tile outtile;
|
mapnik::vector::tile outtile;
|
||||||
|
int features_added = 0;
|
||||||
|
|
||||||
if (is_compressed(message)) {
|
if (is_compressed(message)) {
|
||||||
std::string uncompressed;
|
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++) {
|
for (unsigned i = 0; i < feature_tags.size(); i++) {
|
||||||
outfeature->add_tags(feature_tags[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);
|
pool_free_strings(&values);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (features_added == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
std::string s;
|
std::string s;
|
||||||
std::string compressed;
|
std::string compressed;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user