mirror of
https://github.com/mapbox/tippecanoe.git
synced 2025-02-02 01:08:14 +00:00
Merge branch 'master' into plugins
This commit is contained in:
commit
bf619a315c
@ -1,3 +1,7 @@
|
||||
## 1.16.2
|
||||
|
||||
* Associate attributes with the right layer when explicitly tagged
|
||||
|
||||
## 1.16.1
|
||||
|
||||
* Choose a deeper starting tile than 0/0/0 if there is one that contains
|
||||
|
31
geojson.cpp
31
geojson.cpp
@ -81,7 +81,7 @@ static long long parse_geometry1(int t, json_object *j, long long *bbox, drawvec
|
||||
return geom.size();
|
||||
}
|
||||
|
||||
int serialize_geometry(json_object *geometry, json_object *properties, json_object *id, const char *reading, int line, volatile long long *layer_seq, volatile long long *progress_seq, long long *metapos, long long *geompos, long long *indexpos, std::set<std::string> *exclude, std::set<std::string> *include, int exclude_all, FILE *metafile, FILE *geomfile, FILE *indexfile, struct memfile *poolfile, struct memfile *treefile, const char *fname, int basezoom, int layer, double droprate, long long *file_bbox, json_object *tippecanoe, int segment, int *initialized, unsigned *initial_x, unsigned *initial_y, struct reader *readers, int maxzoom, json_object *feature, std::map<std::string, layermap_entry> *layermap, std::string const &layername, bool uses_gamma) {
|
||||
int serialize_geometry(json_object *geometry, json_object *properties, json_object *id, const char *reading, int line, volatile long long *layer_seq, volatile long long *progress_seq, long long *metapos, long long *geompos, long long *indexpos, std::set<std::string> *exclude, std::set<std::string> *include, int exclude_all, FILE *metafile, FILE *geomfile, FILE *indexfile, struct memfile *poolfile, struct memfile *treefile, const char *fname, int basezoom, int layer, double droprate, long long *file_bbox, json_object *tippecanoe, int segment, int *initialized, unsigned *initial_x, unsigned *initial_y, struct reader *readers, int maxzoom, json_object *feature, std::map<std::string, layermap_entry> *layermap, std::string layername, bool uses_gamma) {
|
||||
json_object *geometry_type = json_hash_get(geometry, "type");
|
||||
if (geometry_type == NULL) {
|
||||
static int warned = 0;
|
||||
@ -171,6 +171,21 @@ int serialize_geometry(json_object *geometry, json_object *properties, json_obje
|
||||
|
||||
long long bbox[] = {LLONG_MAX, LLONG_MAX, LLONG_MIN, LLONG_MIN};
|
||||
|
||||
if (tippecanoe_layername.size() != 0) {
|
||||
if (layermap->count(tippecanoe_layername) == 0) {
|
||||
layermap->insert(std::pair<std::string, layermap_entry>(tippecanoe_layername, layermap_entry(layermap->size())));
|
||||
}
|
||||
|
||||
auto ai = layermap->find(tippecanoe_layername);
|
||||
if (ai != layermap->end()) {
|
||||
layer = ai->second.id;
|
||||
layername = tippecanoe_layername;
|
||||
} else {
|
||||
fprintf(stderr, "Internal error: can't find layer name %s\n", tippecanoe_layername.c_str());
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
size_t nprop = 0;
|
||||
if (properties != NULL && properties->type == JSON_HASH) {
|
||||
nprop = properties->length;
|
||||
@ -270,20 +285,6 @@ int serialize_geometry(json_object *geometry, json_object *properties, json_obje
|
||||
}
|
||||
}
|
||||
|
||||
if (tippecanoe_layername.size() != 0) {
|
||||
if (layermap->count(tippecanoe_layername) == 0) {
|
||||
layermap->insert(std::pair<std::string, layermap_entry>(tippecanoe_layername, layermap_entry(layermap->size())));
|
||||
}
|
||||
|
||||
auto ai = layermap->find(tippecanoe_layername);
|
||||
if (ai != layermap->end()) {
|
||||
layer = ai->second.id;
|
||||
} else {
|
||||
fprintf(stderr, "Internal error: can't find layer name %s\n", tippecanoe_layername.c_str());
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
long long geomstart = *geompos;
|
||||
long long bbox_index;
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
"center": "-122.431641,37.788049,11",
|
||||
"description": "tests/muni/out/-Z11_-z11.json.check.mbtiles",
|
||||
"format": "pbf",
|
||||
"json": "{\"vector_layers\": [ { \"id\": \"muni\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 11, \"fields\": {\"name\": \"String\"} }, { \"id\": \"subway\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 11, \"fields\": {} } ] }",
|
||||
"json": "{\"vector_layers\": [ { \"id\": \"muni\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 11, \"fields\": {\"name\": \"String\"} }, { \"id\": \"subway\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 11, \"fields\": {\"name\": \"String\"} } ] }",
|
||||
"maxzoom": "11",
|
||||
"minzoom": "11",
|
||||
"name": "tests/muni/out/-Z11_-z11.json.check.mbtiles",
|
||||
|
@ -3,7 +3,7 @@
|
||||
"center": "-122.431641,37.788049,11",
|
||||
"description": "tests/muni/out/-Z11_-z11_--calculate-feature-density.json.check.mbtiles",
|
||||
"format": "pbf",
|
||||
"json": "{\"vector_layers\": [ { \"id\": \"muni\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 11, \"fields\": {\"name\": \"String\", \"tippecanoe_feature_density\": \"Number\"} }, { \"id\": \"subway\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 11, \"fields\": {\"tippecanoe_feature_density\": \"Number\"} } ] }",
|
||||
"json": "{\"vector_layers\": [ { \"id\": \"muni\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 11, \"fields\": {\"name\": \"String\", \"tippecanoe_feature_density\": \"Number\"} }, { \"id\": \"subway\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 11, \"fields\": {\"name\": \"String\", \"tippecanoe_feature_density\": \"Number\"} } ] }",
|
||||
"maxzoom": "11",
|
||||
"minzoom": "11",
|
||||
"name": "tests/muni/out/-Z11_-z11_--calculate-feature-density.json.check.mbtiles",
|
||||
|
@ -3,7 +3,7 @@
|
||||
"center": "-122.431641,37.788049,11",
|
||||
"description": "tests/muni/out/-Z11_-z11_--prefer-radix-sort.json.check.mbtiles",
|
||||
"format": "pbf",
|
||||
"json": "{\"vector_layers\": [ { \"id\": \"muni\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 11, \"fields\": {\"name\": \"String\"} }, { \"id\": \"subway\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 11, \"fields\": {} } ] }",
|
||||
"json": "{\"vector_layers\": [ { \"id\": \"muni\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 11, \"fields\": {\"name\": \"String\"} }, { \"id\": \"subway\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 11, \"fields\": {\"name\": \"String\"} } ] }",
|
||||
"maxzoom": "11",
|
||||
"minzoom": "11",
|
||||
"name": "tests/muni/out/-Z11_-z11_--prefer-radix-sort.json.check.mbtiles",
|
||||
|
@ -3,7 +3,7 @@
|
||||
"center": "-122.431641,37.788049,11",
|
||||
"description": "tests/muni/out/-Z11_-z11_-g2.json.check.mbtiles",
|
||||
"format": "pbf",
|
||||
"json": "{\"vector_layers\": [ { \"id\": \"muni\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 11, \"fields\": {\"name\": \"String\"} }, { \"id\": \"subway\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 11, \"fields\": {} } ] }",
|
||||
"json": "{\"vector_layers\": [ { \"id\": \"muni\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 11, \"fields\": {\"name\": \"String\"} }, { \"id\": \"subway\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 11, \"fields\": {\"name\": \"String\"} } ] }",
|
||||
"maxzoom": "11",
|
||||
"minzoom": "11",
|
||||
"name": "tests/muni/out/-Z11_-z11_-g2.json.check.mbtiles",
|
||||
|
@ -3,7 +3,7 @@
|
||||
"center": "-122.409668,37.770713,13",
|
||||
"description": "tests/muni/out/-Z11_-z13_-B15.json.check.mbtiles",
|
||||
"format": "pbf",
|
||||
"json": "{\"vector_layers\": [ { \"id\": \"muni\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 13, \"fields\": {\"name\": \"String\"} }, { \"id\": \"subway\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 13, \"fields\": {} } ] }",
|
||||
"json": "{\"vector_layers\": [ { \"id\": \"muni\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 13, \"fields\": {\"name\": \"String\"} }, { \"id\": \"subway\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 13, \"fields\": {\"name\": \"String\"} } ] }",
|
||||
"maxzoom": "13",
|
||||
"minzoom": "11",
|
||||
"name": "tests/muni/out/-Z11_-z13_-B15.json.check.mbtiles",
|
||||
|
@ -3,7 +3,7 @@
|
||||
"center": "-122.409668,37.770713,13",
|
||||
"description": "tests/muni/out/-Z11_-z13_-Bf2000.json.check.mbtiles",
|
||||
"format": "pbf",
|
||||
"json": "{\"vector_layers\": [ { \"id\": \"muni\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 13, \"fields\": {\"name\": \"String\"} }, { \"id\": \"subway\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 13, \"fields\": {} } ] }",
|
||||
"json": "{\"vector_layers\": [ { \"id\": \"muni\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 13, \"fields\": {\"name\": \"String\"} }, { \"id\": \"subway\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 13, \"fields\": {\"name\": \"String\"} } ] }",
|
||||
"maxzoom": "13",
|
||||
"minzoom": "11",
|
||||
"name": "tests/muni/out/-Z11_-z13_-Bf2000.json.check.mbtiles",
|
||||
|
@ -3,7 +3,7 @@
|
||||
"center": "-122.409668,37.770713,13",
|
||||
"description": "tests/muni/out/-Z11_-z13_-M10000.json.check.mbtiles",
|
||||
"format": "pbf",
|
||||
"json": "{\"vector_layers\": [ { \"id\": \"muni\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 13, \"fields\": {\"name\": \"String\"} }, { \"id\": \"subway\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 13, \"fields\": {} } ] }",
|
||||
"json": "{\"vector_layers\": [ { \"id\": \"muni\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 13, \"fields\": {\"name\": \"String\"} }, { \"id\": \"subway\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 13, \"fields\": {\"name\": \"String\"} } ] }",
|
||||
"maxzoom": "13",
|
||||
"minzoom": "11",
|
||||
"name": "tests/muni/out/-Z11_-z13_-M10000.json.check.mbtiles",
|
||||
|
@ -3,7 +3,7 @@
|
||||
"center": "-122.409668,37.770713,13",
|
||||
"description": "tests/muni/out/-Z11_-z13_-M10000_-aG.json.check.mbtiles",
|
||||
"format": "pbf",
|
||||
"json": "{\"vector_layers\": [ { \"id\": \"muni\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 13, \"fields\": {\"name\": \"String\"} }, { \"id\": \"subway\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 13, \"fields\": {} } ] }",
|
||||
"json": "{\"vector_layers\": [ { \"id\": \"muni\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 13, \"fields\": {\"name\": \"String\"} }, { \"id\": \"subway\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 13, \"fields\": {\"name\": \"String\"} } ] }",
|
||||
"maxzoom": "13",
|
||||
"minzoom": "11",
|
||||
"name": "tests/muni/out/-Z11_-z13_-M10000_-aG.json.check.mbtiles",
|
||||
|
@ -3,7 +3,7 @@
|
||||
"center": "-122.409668,37.770713,13",
|
||||
"description": "tests/muni/out/-Z11_-z13_-M10000_-ad.json.check.mbtiles",
|
||||
"format": "pbf",
|
||||
"json": "{\"vector_layers\": [ { \"id\": \"muni\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 13, \"fields\": {\"name\": \"String\"} }, { \"id\": \"subway\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 13, \"fields\": {} } ] }",
|
||||
"json": "{\"vector_layers\": [ { \"id\": \"muni\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 13, \"fields\": {\"name\": \"String\"} }, { \"id\": \"subway\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 13, \"fields\": {\"name\": \"String\"} } ] }",
|
||||
"maxzoom": "13",
|
||||
"minzoom": "11",
|
||||
"name": "tests/muni/out/-Z11_-z13_-M10000_-ad.json.check.mbtiles",
|
||||
|
@ -3,7 +3,7 @@
|
||||
"center": "-122.409668,37.770713,13",
|
||||
"description": "tests/muni/out/-Z11_-z13_-M10000_-pd.json.check.mbtiles",
|
||||
"format": "pbf",
|
||||
"json": "{\"vector_layers\": [ { \"id\": \"muni\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 13, \"fields\": {\"name\": \"String\"} }, { \"id\": \"subway\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 13, \"fields\": {} } ] }",
|
||||
"json": "{\"vector_layers\": [ { \"id\": \"muni\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 13, \"fields\": {\"name\": \"String\"} }, { \"id\": \"subway\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 13, \"fields\": {\"name\": \"String\"} } ] }",
|
||||
"maxzoom": "13",
|
||||
"minzoom": "11",
|
||||
"name": "tests/muni/out/-Z11_-z13_-M10000_-pd.json.check.mbtiles",
|
||||
|
@ -3,7 +3,7 @@
|
||||
"center": "-122.497559,37.770713,13",
|
||||
"description": "tests/muni/out/-Z11_-z13_-M5000_-as.json.check.mbtiles",
|
||||
"format": "pbf",
|
||||
"json": "{\"vector_layers\": [ { \"id\": \"muni\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 13, \"fields\": {\"name\": \"String\"} }, { \"id\": \"subway\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 13, \"fields\": {} } ] }",
|
||||
"json": "{\"vector_layers\": [ { \"id\": \"muni\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 13, \"fields\": {\"name\": \"String\"} }, { \"id\": \"subway\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 13, \"fields\": {\"name\": \"String\"} } ] }",
|
||||
"maxzoom": "13",
|
||||
"minzoom": "11",
|
||||
"name": "tests/muni/out/-Z11_-z13_-M5000_-as.json.check.mbtiles",
|
||||
|
@ -3,7 +3,7 @@
|
||||
"center": "-122.409668,37.770713,13",
|
||||
"description": "tests/muni/out/-Z11_-z13_-rf2000.json.check.mbtiles",
|
||||
"format": "pbf",
|
||||
"json": "{\"vector_layers\": [ { \"id\": \"muni\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 13, \"fields\": {\"name\": \"String\"} }, { \"id\": \"subway\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 13, \"fields\": {} } ] }",
|
||||
"json": "{\"vector_layers\": [ { \"id\": \"muni\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 13, \"fields\": {\"name\": \"String\"} }, { \"id\": \"subway\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 13, \"fields\": {\"name\": \"String\"} } ] }",
|
||||
"maxzoom": "13",
|
||||
"minzoom": "11",
|
||||
"name": "tests/muni/out/-Z11_-z13_-rf2000.json.check.mbtiles",
|
||||
|
@ -3,7 +3,7 @@
|
||||
"center": "-122.409668,37.770713,13",
|
||||
"description": "tests/muni/out/-Z11_-z13_-rf2000_-Bg.json.check.mbtiles",
|
||||
"format": "pbf",
|
||||
"json": "{\"vector_layers\": [ { \"id\": \"muni\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 13, \"fields\": {\"name\": \"String\"} }, { \"id\": \"subway\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 13, \"fields\": {} } ] }",
|
||||
"json": "{\"vector_layers\": [ { \"id\": \"muni\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 13, \"fields\": {\"name\": \"String\"} }, { \"id\": \"subway\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 13, \"fields\": {\"name\": \"String\"} } ] }",
|
||||
"maxzoom": "13",
|
||||
"minzoom": "11",
|
||||
"name": "tests/muni/out/-Z11_-z13_-rf2000_-Bg.json.check.mbtiles",
|
||||
|
@ -3,7 +3,7 @@
|
||||
"center": "-122.409668,37.770713,13",
|
||||
"description": "tests/muni/out/-Z11_-z13_-rf2000_-g2.json.check.mbtiles",
|
||||
"format": "pbf",
|
||||
"json": "{\"vector_layers\": [ { \"id\": \"muni\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 13, \"fields\": {\"name\": \"String\"} }, { \"id\": \"subway\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 13, \"fields\": {} } ] }",
|
||||
"json": "{\"vector_layers\": [ { \"id\": \"muni\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 13, \"fields\": {\"name\": \"String\"} }, { \"id\": \"subway\", \"description\": \"\", \"minzoom\": 11, \"maxzoom\": 13, \"fields\": {\"name\": \"String\"} } ] }",
|
||||
"maxzoom": "13",
|
||||
"minzoom": "11",
|
||||
"name": "tests/muni/out/-Z11_-z13_-rf2000_-g2.json.check.mbtiles",
|
||||
|
@ -3,7 +3,7 @@
|
||||
"center": "-90.000000,37.836443,1",
|
||||
"description": "tests/muni/out/-z1_-Z1_-ao_-P.json.check.mbtiles",
|
||||
"format": "pbf",
|
||||
"json": "{\"vector_layers\": [ { \"id\": \"muni\", \"description\": \"\", \"minzoom\": 1, \"maxzoom\": 1, \"fields\": {\"name\": \"String\"} }, { \"id\": \"subway\", \"description\": \"\", \"minzoom\": 1, \"maxzoom\": 1, \"fields\": {} } ] }",
|
||||
"json": "{\"vector_layers\": [ { \"id\": \"muni\", \"description\": \"\", \"minzoom\": 1, \"maxzoom\": 1, \"fields\": {\"name\": \"String\"} }, { \"id\": \"subway\", \"description\": \"\", \"minzoom\": 1, \"maxzoom\": 1, \"fields\": {\"name\": \"String\"} } ] }",
|
||||
"maxzoom": "1",
|
||||
"minzoom": "1",
|
||||
"name": "tests/muni/out/-z1_-Z1_-ao_-P.json.check.mbtiles",
|
||||
|
@ -1 +1 @@
|
||||
#define VERSION "tippecanoe v1.16.1\n"
|
||||
#define VERSION "tippecanoe v1.16.2\n"
|
||||
|
Loading…
x
Reference in New Issue
Block a user