mirror of
https://github.com/mapbox/tippecanoe.git
synced 2025-01-22 04:18:01 +00:00
Don't put a comma between features in filter output
This commit is contained in:
parent
8cf81483b1
commit
6530e155eb
@ -63,7 +63,7 @@ void handle(std::string message, int z, unsigned x, unsigned y, int describe) {
|
|||||||
within = 0;
|
within = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
layer_to_geojson(stdout, layer, z, x, y);
|
layer_to_geojson(stdout, layer, z, x, y, true);
|
||||||
|
|
||||||
if (describe) {
|
if (describe) {
|
||||||
printf("] }\n");
|
printf("] }\n");
|
||||||
|
@ -41,7 +41,7 @@ void *run_writer(void *a) {
|
|||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
layer_to_geojson(fp, *(wa->layer), wa->z, wa->x, wa->y);
|
layer_to_geojson(fp, *(wa->layer), wa->z, wa->x, wa->y, false);
|
||||||
|
|
||||||
if (fclose(fp) != 0) {
|
if (fclose(fp) != 0) {
|
||||||
perror("fclose output to filter");
|
perror("fclose output to filter");
|
||||||
|
@ -24,11 +24,11 @@ struct lonlat {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
void layer_to_geojson(FILE *fp, mvt_layer &layer, unsigned z, unsigned x, unsigned y) {
|
void layer_to_geojson(FILE *fp, mvt_layer &layer, unsigned z, unsigned x, unsigned y, bool comma) {
|
||||||
for (size_t f = 0; f < layer.features.size(); f++) {
|
for (size_t f = 0; f < layer.features.size(); f++) {
|
||||||
mvt_feature &feat = layer.features[f];
|
mvt_feature &feat = layer.features[f];
|
||||||
|
|
||||||
if (f != 0) {
|
if (comma && f != 0) {
|
||||||
fprintf(fp, ",\n");
|
fprintf(fp, ",\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
void layer_to_geojson(FILE *fp, mvt_layer &layer, unsigned z, unsigned x, unsigned y);
|
void layer_to_geojson(FILE *fp, mvt_layer &layer, unsigned z, unsigned x, unsigned y, bool comma);
|
||||||
void fprintq(FILE *f, const char *s);
|
void fprintq(FILE *f, const char *s);
|
||||||
|
Loading…
Reference in New Issue
Block a user