mirror of
https://github.com/mapbox/tippecanoe.git
synced 2025-03-25 21:27:37 +00:00
Track layer description as part of the tilestats
This commit is contained in:
parent
b65a5d1bb8
commit
7128ac44d5
2
main.cpp
2
main.cpp
@ -83,6 +83,7 @@ int additional[256];
|
||||
struct source {
|
||||
std::string layer = "";
|
||||
std::string file = "";
|
||||
std::string description = "";
|
||||
};
|
||||
|
||||
size_t CPUS;
|
||||
@ -1303,6 +1304,7 @@ int read_input(std::vector<source> &sources, char *fname, int maxzoom, int minzo
|
||||
std::map<std::string, layermap_entry> layermap;
|
||||
for (size_t l = 0; l < nlayers; l++) {
|
||||
layermap_entry e = layermap_entry(l);
|
||||
e.description = sources[l].description;
|
||||
layermap.insert(std::pair<std::string, layermap_entry>(sources[l].layer, e));
|
||||
}
|
||||
|
||||
|
@ -397,7 +397,7 @@ void mbtiles_write_metadata(sqlite3 *outdb, const char *outdir, const char *fnam
|
||||
state.json_write_string(lnames[i]);
|
||||
|
||||
state.json_write_string("description");
|
||||
state.json_write_string("");
|
||||
state.json_write_string(fk->second.description);
|
||||
|
||||
state.json_write_string("minzoom");
|
||||
state.json_write_signed(fk->second.minzoom);
|
||||
@ -550,6 +550,7 @@ std::map<std::string, layermap_entry> merge_layermaps(std::vector<std::map<std::
|
||||
auto out_entry = out.find(layername);
|
||||
out_entry->second.minzoom = map->second.minzoom;
|
||||
out_entry->second.maxzoom = map->second.maxzoom;
|
||||
out_entry->second.description = map->second.description;
|
||||
}
|
||||
|
||||
auto out_entry = out.find(layername);
|
||||
|
@ -25,6 +25,7 @@ struct layermap_entry {
|
||||
std::map<std::string, type_and_string_stats> file_keys{};
|
||||
int minzoom = 0;
|
||||
int maxzoom = 0;
|
||||
std::string description = "";
|
||||
|
||||
size_t points = 0;
|
||||
size_t lines = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user