Merge PR #393 (MLT output format) into main

This commit is contained in:
Claude
2026-08-06 16:44:49 +00:00
17 changed files with 374 additions and 18 deletions
+9 -2
View File
@@ -39,6 +39,7 @@
#include "serial.hpp"
#include "options.hpp"
#include "main.hpp"
#include "mlt.hpp"
#include "write_json.hpp"
#include "milo/dtoa_milo.h"
#include "evaluator.hpp"
@@ -2853,7 +2854,12 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
}
std::string compressed;
std::string pbf = tile.encode();
std::string pbf;
if (output_format == OUTPUT_MLT) {
pbf = encode_as_mlt(tile, mlt_sort_features, mlt_pretessellate);
} else {
pbf = tile.encode();
}
tile.layers.clear();
@@ -3028,7 +3034,8 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
if (outdb != NULL) {
mbtiles_write_tile(outdb, z, tx, ty, compressed.data(), compressed.size());
} else if (outdir != NULL) {
dir_write_tile(outdir, z, tx, ty, compressed);
const char *tile_ext = (output_format == OUTPUT_MLT) ? ".mlt" : ".pbf";
dir_write_tile(outdir, z, tx, ty, compressed, tile_ext);
}
if (pthread_mutex_unlock(&db_lock) != 0) {