mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-03 08:55:41 +02:00
Merge files into one layer if a name is specified with -l
This commit is contained in:
@@ -109,6 +109,20 @@ void handle(std::string message, int z, unsigned x, unsigned y, int describe) {
|
||||
mapnik::vector::tile_layer layer = tile.layers(l);
|
||||
int extent = layer.extent();
|
||||
|
||||
if (describe) {
|
||||
if (l != 0) {
|
||||
printf(",\n");
|
||||
}
|
||||
|
||||
printf("{ \"type\": \"FeatureCollection\"");
|
||||
printf(", \"properties\": { \"name\": ");
|
||||
printq(layer.name().c_str());
|
||||
printf(" }");
|
||||
printf(", \"features\": [\n");
|
||||
|
||||
within = 0;
|
||||
}
|
||||
|
||||
for (int f = 0; f < layer.features_size(); f++) {
|
||||
mapnik::vector::tile_feature feat = layer.features(f);
|
||||
int px = 0, py = 0;
|
||||
@@ -275,6 +289,7 @@ void handle(std::string message, int z, unsigned x, unsigned y, int describe) {
|
||||
|
||||
int state = 0;
|
||||
for (unsigned i = 0; i < rings.size(); i++) {
|
||||
printf("AREA %f ", areas[i]);
|
||||
if (areas[i] <= 0) {
|
||||
if (state != 0) {
|
||||
// new multipolygon
|
||||
@@ -316,6 +331,10 @@ void handle(std::string message, int z, unsigned x, unsigned y, int describe) {
|
||||
|
||||
printf(" } }\n");
|
||||
}
|
||||
|
||||
if (describe) {
|
||||
printf("] }\n");
|
||||
}
|
||||
}
|
||||
|
||||
printf("] }\n");
|
||||
|
||||
Reference in New Issue
Block a user