mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-02 16:35:40 +02:00
The GeoJSON-producing part of prefiltering
This commit is contained in:
+7
-1
@@ -24,7 +24,7 @@ struct lonlat {
|
||||
}
|
||||
};
|
||||
|
||||
void layer_to_geojson(FILE *fp, mvt_layer &layer, unsigned z, unsigned x, unsigned y, bool comma) {
|
||||
void layer_to_geojson(FILE *fp, mvt_layer &layer, unsigned z, unsigned x, unsigned y, bool comma, bool name) {
|
||||
for (size_t f = 0; f < layer.features.size(); f++) {
|
||||
mvt_feature &feat = layer.features[f];
|
||||
|
||||
@@ -38,6 +38,12 @@ void layer_to_geojson(FILE *fp, mvt_layer &layer, unsigned z, unsigned x, unsign
|
||||
fprintf(fp, ", \"id\": %llu", feat.id);
|
||||
}
|
||||
|
||||
if (name) {
|
||||
fprintf(fp, ", \"tippecanoe\": { \"layer\": ");
|
||||
fprintq(fp, layer.name.c_str());
|
||||
fprintf(fp, " }");
|
||||
}
|
||||
|
||||
fprintf(fp, ", \"properties\": { ");
|
||||
|
||||
for (size_t t = 0; t + 1 < feat.tags.size(); t += 2) {
|
||||
|
||||
Reference in New Issue
Block a user