mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-04 17:35:42 +02:00
Don't produce layers with no features. Say "layer" instead of "name" in decode.
This commit is contained in:
@@ -115,7 +115,7 @@ void handle(std::string message, int z, unsigned x, unsigned y, int describe) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
printf("{ \"type\": \"FeatureCollection\"");
|
printf("{ \"type\": \"FeatureCollection\"");
|
||||||
printf(", \"properties\": { \"name\": ");
|
printf(", \"properties\": { \"layer\": ");
|
||||||
printq(layer.name().c_str());
|
printq(layer.name().c_str());
|
||||||
printf(" }");
|
printf(" }");
|
||||||
printf(", \"features\": [\n");
|
printf(", \"features\": [\n");
|
||||||
|
|||||||
@@ -246,6 +246,10 @@ mapnik::vector::tile create_tile(char **layernames, int line_detail, std::vector
|
|||||||
|
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < nlayers; i++) {
|
for (i = 0; i < nlayers; i++) {
|
||||||
|
if (features[i].size() == 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
mapnik::vector::tile_layer *layer = tile.add_layers();
|
mapnik::vector::tile_layer *layer = tile.add_layers();
|
||||||
|
|
||||||
layer->set_name(layernames[i]);
|
layer->set_name(layernames[i]);
|
||||||
|
|||||||
Reference in New Issue
Block a user