Limit the length of the generator_options in the tileset metadata

This commit is contained in:
Eric Fischer 2020-01-08 15:25:16 -08:00
parent 065cc1d78d
commit 7a9f1d0977
4 changed files with 13 additions and 4 deletions

View File

@ -1,3 +1,7 @@
## 1.34.7
* Limit the length of the generator_options in the tileset metadata
## 1.34.6
* Fix crash when there are null entries in the metadata table

View File

@ -3,7 +3,7 @@
"center": "-122.104097,37.695438,0",
"description": "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
"format": "pbf",
"generator_options": "./tippecanoe -q -f -z0 -n abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ -o tests/join-population/macarthur.mbtiles tests/join-population/macarthur.json; ./tippecanoe -q -f -z0 -n abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ -o tests/join-population/macarthur.mbtiles tests/join-population/macarthur.json; ./tippecanoe -q -f -z0 -n abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ -o tests/join-population/macarthur.mbtiles tests/join-population/macarthur.json; ./tippecanoe -q -f -z0 -n abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ -o tests/join-population/macarthur.mbtiles tests/join-population/macarthur.json; ./tippecanoe -q -f -z0 -n abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ -o tests/join-population/macarthur.mbtiles tests/join-population/macarthur.json; ./tippecanoe -q -f -z0 -n abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ -o tests/join-population/macarthur.mbtiles tests/join-population/macarthur.json; ./tile-join -f -o tests/join-population/concat.mbtiles tests/join-population/macarthur.mbtiles tests/join-population/macarthur.mbtiles tests/join-population/macarthur.mbtiles tests/join-population/macarthur.mbtiles tests/join-population/macarthur.mbtiles tests/join-population/macarthur.mbtiles",
"generator_options": "...; ./tippecanoe -q -f -z0 -n abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ -o tests/join-population/macarthur.mbtiles tests/join-population/macarthur.json; ./tippecanoe -q -f -z0 -n abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ -o tests/join-population/macarthur.mbtiles tests/join-population/macarthur.json; ./tippecanoe -q -f -z0 -n abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ -o tests/join-population/macarthur.mbtiles tests/join-population/macarthur.json; ./tile-join -f -o tests/join-population/concat.mbtiles tests/join-population/macarthur.mbtiles tests/join-population/macarthur.mbtiles tests/join-population/macarthur.mbtiles tests/join-population/macarthur.mbtiles tests/join-population/macarthur.mbtiles tests/join-population/macarthur.mbtiles",
"json": "{\"vector_layers\": [ { \"id\": \"macarthur\", \"description\": \"\", \"minzoom\": 0, \"maxzoom\": 0, \"fields\": {\"FULLNAME\": \"String\", \"LINEARID\": \"String\", \"MTFCC\": \"String\", \"RTTYP\": \"String\"} } ],\"tilestats\": {\"layerCount\": 1,\"layers\": [{\"layer\": \"macarthur\",\"count\": 24,\"geometry\": \"LineString\",\"attributeCount\": 4,\"attributes\": [{\"attribute\": \"FULLNAME\",\"count\": 3,\"type\": \"string\",\"values\": [\"Macarthur\",\"Macarthur Fwy\",\"W Macarthur\"]},{\"attribute\": \"LINEARID\",\"count\": 4,\"type\": \"string\",\"values\": [\"1102954918511\",\"1104474748623\",\"1104486090991\",\"1104486392881\"]},{\"attribute\": \"MTFCC\",\"count\": 2,\"type\": \"string\",\"values\": [\"S1100\",\"S1400\"]},{\"attribute\": \"RTTYP\",\"count\": 1,\"type\": \"string\",\"values\": [\"M\"]}]}]}}",
"maxzoom": "0",
"minzoom": "0",

View File

@ -830,8 +830,13 @@ void decode(struct reader *readers, std::map<std::string, layermap_entry> &layer
const unsigned char *s = sqlite3_column_text(r->stmt, 0);
if (s != NULL) {
if (generator_options.size() != 0) {
generator_options.append("; ");
generator_options.append((const char *) s);
if (generator_options.size() + strlen((const char *) s) > 500) {
generator_options = "...; ";
generator_options.append((const char *) s);
} else {
generator_options.append("; ");
generator_options.append((const char *) s);
}
} else {
generator_options = (const char *) s;
}

View File

@ -1,6 +1,6 @@
#ifndef VERSION_HPP
#define VERSION_HPP
#define VERSION "v1.34.6"
#define VERSION "v1.34.7"
#endif