mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-02 16:35:40 +02:00
Integrate the C++ MLT encoder from maplibre-tile-spec as a submodule. Tiles are encoded by converting the existing mvt_tile to mlt::Encoder::Layer and calling the encoder library directly. New CLI flags: --output-format=mlt Encode tiles as MLT instead of MVT --pretessellate Pre-triangulate polygons (MLT only) --no-mlt-feature-sort Disable within-tile Hilbert sorting (MLT only) MLT tiles use .mlt extension in directory output and format=mlt in mbtiles metadata. Compression and all existing flags work unchanged.
53 lines
1.1 KiB
C++
53 lines
1.1 KiB
C++
#include <string>
|
|
#include <vector>
|
|
#include <sys/stat.h>
|
|
#include "mbtiles.hpp"
|
|
|
|
#ifndef DIRTILES_HPP
|
|
#define DIRTILES_HPP
|
|
|
|
void dir_write_tile(const char *outdir, int z, int tx, int ty, std::string const &pbf, const char *ext = ".pbf");
|
|
void dir_erase_zoom(const char *outdir, int z);
|
|
void dir_write_metadata(const char *outdir, const metadata &m);
|
|
|
|
void check_dir(const char *d, char **argv, bool force, bool forcetable);
|
|
|
|
struct zxy {
|
|
long long z;
|
|
long long x;
|
|
long long y;
|
|
std::string extension = ".pbf";
|
|
|
|
zxy(int _z, int _x, int _y)
|
|
: z(_z), x(_x), y(_y) {
|
|
}
|
|
|
|
bool operator<(const zxy &other) const {
|
|
if (z < other.z) {
|
|
return true;
|
|
}
|
|
if (z == other.z) {
|
|
if (x < other.x) {
|
|
return true;
|
|
}
|
|
if (x == other.x) {
|
|
if (y > other.y) {
|
|
return true; // reversed for TMS
|
|
}
|
|
}
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
std::string path() {
|
|
return std::to_string(z) + "/" + std::to_string(x) + "/" + std::to_string(y) + extension;
|
|
}
|
|
};
|
|
|
|
std::vector<zxy> enumerate_dirtiles(const char *fname, int minzoom, int maxzoom);
|
|
sqlite3 *dirmeta2tmp(const char *fname);
|
|
std::string dir_read_tile(std::string pbfPath, struct zxy tile);
|
|
|
|
#endif
|