mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-02 08:25:40 +02:00
Don't put a comma between features in filter output
This commit is contained in:
+1
-1
@@ -63,7 +63,7 @@ void handle(std::string message, int z, unsigned x, unsigned y, int describe) {
|
||||
within = 0;
|
||||
}
|
||||
|
||||
layer_to_geojson(stdout, layer, z, x, y);
|
||||
layer_to_geojson(stdout, layer, z, x, y, true);
|
||||
|
||||
if (describe) {
|
||||
printf("] }\n");
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ void *run_writer(void *a) {
|
||||
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) {
|
||||
perror("fclose output to filter");
|
||||
|
||||
+2
-2
@@ -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++) {
|
||||
mvt_feature &feat = layer.features[f];
|
||||
|
||||
if (f != 0) {
|
||||
if (comma && f != 0) {
|
||||
fprintf(fp, ",\n");
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user