mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-02 08:25:40 +02:00
Make feature ordering cooperate with --retain-points-multiplier (#188)
* Make feature ordering cooperate with --retain-points-multiplier * Forgot to check in the actual code changes??? * Sort within each multiplier cluster as well as between clusters * Correct description of behavior in changelog * Drag original feature sequence along in megatiles for post-filter sort * Plumb the preserve-input-order flag through overzoom * Sort in overzoom if requested * Use within-tile input sequence numbers, not global sequence numbers * Documentation * Reverse direction of search to prevent accidental skipping * Add some comments about converting between attribute representations
This commit is contained in:
@@ -1,3 +1,7 @@
|
|||||||
|
# 2.41.1
|
||||||
|
|
||||||
|
* Make --preserve-input-order, --order-by, --order-descending-by, --order-smallest-first, and --order-largest-first cooperate with --retain-points-multiplier. The clusters will be ordered by their lead feature in the specified sequence. The other features in each cluster will continue to be physically near the lead feature, but ordered as specified within the cluster.
|
||||||
|
|
||||||
# 2.41.0
|
# 2.41.0
|
||||||
|
|
||||||
* Add Felt-style expression support for -j feature filters
|
* Add Felt-style expression support for -j feature filters
|
||||||
|
|||||||
@@ -310,6 +310,12 @@ overzoom-test: tippecanoe-overzoom
|
|||||||
./tippecanoe-decode tests/pbf/0-0-0-filter-mult.pbf 0 0 0 > tests/pbf/0-0-0-filter-mult.pbf.json.check
|
./tippecanoe-decode tests/pbf/0-0-0-filter-mult.pbf 0 0 0 > tests/pbf/0-0-0-filter-mult.pbf.json.check
|
||||||
cmp tests/pbf/0-0-0-filter-mult.pbf.json.check tests/pbf/0-0-0-filter-mult.pbf.json
|
cmp tests/pbf/0-0-0-filter-mult.pbf.json.check tests/pbf/0-0-0-filter-mult.pbf.json
|
||||||
rm tests/pbf/0-0-0-filter-mult.pbf tests/pbf/0-0-0-filter-mult.pbf.json.check
|
rm tests/pbf/0-0-0-filter-mult.pbf tests/pbf/0-0-0-filter-mult.pbf.json.check
|
||||||
|
# Filtering with multiplier and preserve-input-order
|
||||||
|
# 243 features in the source tile tests/pbf/0-0-0-pop.pbf
|
||||||
|
./tippecanoe-overzoom -y NAME -y SCALERANK -j'{"*":["NAME","cn","e"]}' -m --preserve-input-order -o tests/pbf/0-0-0-filter-mult-order.pbf tests/pbf/0-0-0-pop.pbf 0/0/0 0/0/0
|
||||||
|
./tippecanoe-decode tests/pbf/0-0-0-filter-mult-order.pbf 0 0 0 > tests/pbf/0-0-0-filter-mult-order.pbf.json.check
|
||||||
|
cmp tests/pbf/0-0-0-filter-mult-order.pbf.json.check tests/pbf/0-0-0-filter-mult-order.pbf.json
|
||||||
|
rm tests/pbf/0-0-0-filter-mult-order.pbf tests/pbf/0-0-0-filter-mult-order.pbf.json.check
|
||||||
# Test that overzooming with a multiplier exactly reverses the effect of tiling with a multiplier
|
# Test that overzooming with a multiplier exactly reverses the effect of tiling with a multiplier
|
||||||
./tippecanoe -q -z5 --preserve-point-density-threshold 8 --retain-points-multiplier 3 -f -e tests/muni/out/out.dir tests/muni/muni.json
|
./tippecanoe -q -z5 --preserve-point-density-threshold 8 --retain-points-multiplier 3 -f -e tests/muni/out/out.dir tests/muni/muni.json
|
||||||
./tippecanoe -q -z5 --preserve-point-density-threshold 8 -f -o tests/muni/out/out.mbtiles tests/muni/muni.json
|
./tippecanoe -q -z5 --preserve-point-density-threshold 8 -f -o tests/muni/out/out.mbtiles tests/muni/muni.json
|
||||||
|
|||||||
@@ -996,4 +996,4 @@ reads tile `inz/inx/iny` of `in.mvt.gz` and produces tile `outz/outx/outy` of `o
|
|||||||
* `-y` *attribute*: Retain the specified *attribute* in the output features. All attributes that are not named in a `-y` option will be removed.
|
* `-y` *attribute*: Retain the specified *attribute* in the output features. All attributes that are not named in a `-y` option will be removed.
|
||||||
* `-j` *filter*: Filter features using the same expression syntax as in tippecanoe.
|
* `-j` *filter*: Filter features using the same expression syntax as in tippecanoe.
|
||||||
* `-m`: If a tile was created with the `--retain-points-multiplier` option, thin the tile back down to its normal feature count during overzooming. The first feature from each cluster will be retained, unless `-j` is used to specify a filter, in which case the first matching filter from each cluster will be retained instead.
|
* `-m`: If a tile was created with the `--retain-points-multiplier` option, thin the tile back down to its normal feature count during overzooming. The first feature from each cluster will be retained, unless `-j` is used to specify a filter, in which case the first matching filter from each cluster will be retained instead.
|
||||||
|
* `--preserve-input-order`: Restore a set of filtered features to its original input order
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
#include "compression.hpp"
|
#include "compression.hpp"
|
||||||
#include "mvt.hpp"
|
#include "mvt.hpp"
|
||||||
#include "evaluator.hpp"
|
#include "evaluator.hpp"
|
||||||
|
#include "serial.hpp"
|
||||||
|
|
||||||
static std::vector<std::pair<double, double>> clip_poly1(std::vector<std::pair<double, double>> &geom,
|
static std::vector<std::pair<double, double>> clip_poly1(std::vector<std::pair<double, double>> &geom,
|
||||||
long long minx, long long miny, long long maxx, long long maxy,
|
long long minx, long long miny, long long maxx, long long maxy,
|
||||||
@@ -756,7 +757,7 @@ static std::vector<std::pair<double, double>> clip_poly1(std::vector<std::pair<d
|
|||||||
std::string overzoom(std::string s, int oz, int ox, int oy, int nz, int nx, int ny,
|
std::string overzoom(std::string s, int oz, int ox, int oy, int nz, int nx, int ny,
|
||||||
int detail, int buffer, std::set<std::string> const &keep, bool do_compress,
|
int detail, int buffer, std::set<std::string> const &keep, bool do_compress,
|
||||||
std::vector<std::pair<unsigned, unsigned>> *next_overzoomed_tiles,
|
std::vector<std::pair<unsigned, unsigned>> *next_overzoomed_tiles,
|
||||||
bool demultiply, json_object *filter) {
|
bool demultiply, json_object *filter, bool preserve_input_order) {
|
||||||
mvt_tile tile;
|
mvt_tile tile;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -770,7 +771,7 @@ std::string overzoom(std::string s, int oz, int ox, int oy, int nz, int nx, int
|
|||||||
exit(EXIT_PROTOBUF);
|
exit(EXIT_PROTOBUF);
|
||||||
}
|
}
|
||||||
|
|
||||||
return overzoom(tile, oz, ox, oy, nz, nx, ny, detail, buffer, keep, do_compress, next_overzoomed_tiles, demultiply, filter);
|
return overzoom(tile, oz, ox, oy, nz, nx, ny, detail, buffer, keep, do_compress, next_overzoomed_tiles, demultiply, filter, preserve_input_order);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct tile_feature {
|
struct tile_feature {
|
||||||
@@ -780,6 +781,7 @@ struct tile_feature {
|
|||||||
unsigned long long id;
|
unsigned long long id;
|
||||||
std::vector<unsigned> tags;
|
std::vector<unsigned> tags;
|
||||||
mvt_layer const *layer;
|
mvt_layer const *layer;
|
||||||
|
size_t seq = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
void feature_out(tile_feature const &feature, mvt_layer &outlayer, std::set<std::string> const &keep) {
|
void feature_out(tile_feature const &feature, mvt_layer &outlayer, std::set<std::string> const &keep) {
|
||||||
@@ -799,6 +801,8 @@ void feature_out(tile_feature const &feature, mvt_layer &outlayer, std::set<std:
|
|||||||
outfeature.id = feature.id;
|
outfeature.id = feature.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
outfeature.seq = feature.seq;
|
||||||
|
|
||||||
for (size_t i = 0; i + 1 < feature.tags.size(); i += 2) {
|
for (size_t i = 0; i + 1 < feature.tags.size(); i += 2) {
|
||||||
if (keep.size() == 0 || keep.find(feature.layer->keys[feature.tags[i]]) != keep.end()) {
|
if (keep.size() == 0 || keep.find(feature.layer->keys[feature.tags[i]]) != keep.end()) {
|
||||||
outlayer.tag(outfeature, feature.layer->keys[feature.tags[i]], feature.layer->values[feature.tags[i + 1]]);
|
outlayer.tag(outfeature, feature.layer->keys[feature.tags[i]], feature.layer->values[feature.tags[i + 1]]);
|
||||||
@@ -809,10 +813,16 @@ void feature_out(tile_feature const &feature, mvt_layer &outlayer, std::set<std:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static struct preservecmp {
|
||||||
|
bool operator()(const mvt_feature &a, const mvt_feature &b) {
|
||||||
|
return a.seq < b.seq;
|
||||||
|
}
|
||||||
|
} preservecmp;
|
||||||
|
|
||||||
std::string overzoom(mvt_tile tile, int oz, int ox, int oy, int nz, int nx, int ny,
|
std::string overzoom(mvt_tile tile, int oz, int ox, int oy, int nz, int nx, int ny,
|
||||||
int detail, int buffer, std::set<std::string> const &keep, bool do_compress,
|
int detail, int buffer, std::set<std::string> const &keep, bool do_compress,
|
||||||
std::vector<std::pair<unsigned, unsigned>> *next_overzoomed_tiles,
|
std::vector<std::pair<unsigned, unsigned>> *next_overzoomed_tiles,
|
||||||
bool demultiply, json_object *filter) {
|
bool demultiply, json_object *filter, bool preserve_input_order) {
|
||||||
mvt_tile outtile;
|
mvt_tile outtile;
|
||||||
|
|
||||||
for (auto const &layer : tile.layers) {
|
for (auto const &layer : tile.layers) {
|
||||||
@@ -832,15 +842,20 @@ std::string overzoom(mvt_tile tile, int oz, int ox, int oy, int nz, int nx, int
|
|||||||
for (auto feature : layer.features) {
|
for (auto feature : layer.features) {
|
||||||
bool flush_multiplier_cluster = false;
|
bool flush_multiplier_cluster = false;
|
||||||
if (demultiply) {
|
if (demultiply) {
|
||||||
for (size_t i = 0; i + 1 < feature.tags.size(); i += 2) {
|
for (ssize_t i = feature.tags.size() - 2; i >= 0; i -= 2) {
|
||||||
if (layer.keys[feature.tags[i]] == "tippecanoe:retain_points_multiplier_first") {
|
if (layer.keys[feature.tags[i]] == "tippecanoe:retain_points_multiplier_first") {
|
||||||
mvt_value v = layer.values[feature.tags[i + 1]];
|
mvt_value v = layer.values[feature.tags[i + 1]];
|
||||||
if (v.type == mvt_bool && v.numeric_value.bool_value) {
|
if (v.type == mvt_bool && v.numeric_value.bool_value) {
|
||||||
flush_multiplier_cluster = true;
|
flush_multiplier_cluster = true;
|
||||||
feature.tags.erase(feature.tags.begin() + i, feature.tags.begin() + i + 2);
|
feature.tags.erase(feature.tags.begin() + i, feature.tags.begin() + i + 2);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (layer.keys[feature.tags[i]] == "tippecanoe:retain_points_multiplier_sequence") {
|
||||||
|
mvt_value v = layer.values[feature.tags[i + 1]];
|
||||||
|
feature.seq = atoll(mvt_value_to_serial_val(v).s.c_str());
|
||||||
|
feature.tags.erase(feature.tags.begin() + i, feature.tags.begin() + i + 2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
flush_multiplier_cluster = true;
|
flush_multiplier_cluster = true;
|
||||||
@@ -937,6 +952,7 @@ std::string overzoom(mvt_tile tile, int oz, int ox, int oy, int nz, int nx, int
|
|||||||
tf.id = feature.id;
|
tf.id = feature.id;
|
||||||
tf.tags = feature.tags;
|
tf.tags = feature.tags;
|
||||||
tf.layer = &layer;
|
tf.layer = &layer;
|
||||||
|
tf.seq = feature.seq;
|
||||||
|
|
||||||
pending_tile_features.push_back(tf);
|
pending_tile_features.push_back(tf);
|
||||||
}
|
}
|
||||||
@@ -946,6 +962,10 @@ std::string overzoom(mvt_tile tile, int oz, int ox, int oy, int nz, int nx, int
|
|||||||
pending_tile_features.clear();
|
pending_tile_features.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (preserve_input_order) {
|
||||||
|
std::sort(outlayer.features.begin(), outlayer.features.end(), preservecmp);
|
||||||
|
}
|
||||||
|
|
||||||
if (outlayer.features.size() > 0) {
|
if (outlayer.features.size() > 0) {
|
||||||
outtile.layers.push_back(outlayer);
|
outtile.layers.push_back(outlayer);
|
||||||
}
|
}
|
||||||
@@ -965,7 +985,7 @@ std::string overzoom(mvt_tile tile, int oz, int ox, int oy, int nz, int nx, int
|
|||||||
std::string child = overzoom(outtile, nz, nx, ny,
|
std::string child = overzoom(outtile, nz, nx, ny,
|
||||||
nz + 1, nx * 2 + x, ny * 2 + y,
|
nz + 1, nx * 2 + x, ny * 2 + y,
|
||||||
detail, buffer, keep, false, NULL,
|
detail, buffer, keep, false, NULL,
|
||||||
demultiply, filter);
|
demultiply, filter, preserve_input_order);
|
||||||
if (child.size() > 0) {
|
if (child.size() > 0) {
|
||||||
next_overzoomed_tiles->emplace_back(nx * 2 + x, ny * 2 + y);
|
next_overzoomed_tiles->emplace_back(nx * 2 + x, ny * 2 + y);
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -102,11 +102,11 @@ double distance_from_line(long long point_x, long long point_y, long long segA_x
|
|||||||
std::string overzoom(mvt_tile tile, int oz, int ox, int oy, int nz, int nx, int ny,
|
std::string overzoom(mvt_tile tile, int oz, int ox, int oy, int nz, int nx, int ny,
|
||||||
int detail, int buffer, std::set<std::string> const &keep, bool do_compress,
|
int detail, int buffer, std::set<std::string> const &keep, bool do_compress,
|
||||||
std::vector<std::pair<unsigned, unsigned>> *next_overzoomed_tiles,
|
std::vector<std::pair<unsigned, unsigned>> *next_overzoomed_tiles,
|
||||||
bool demultiply, json_object *filter);
|
bool demultiply, json_object *filter, bool preserve_input_order);
|
||||||
|
|
||||||
std::string overzoom(std::string s, int oz, int ox, int oy, int nz, int nx, int ny,
|
std::string overzoom(std::string s, int oz, int ox, int oy, int nz, int nx, int ny,
|
||||||
int detail, int buffer, std::set<std::string> const &keep, bool do_compress,
|
int detail, int buffer, std::set<std::string> const &keep, bool do_compress,
|
||||||
std::vector<std::pair<unsigned, unsigned>> *next_overzoomed_tiles,
|
std::vector<std::pair<unsigned, unsigned>> *next_overzoomed_tiles,
|
||||||
bool demultiply, json_object *filter);
|
bool demultiply, json_object *filter, bool preserve_input_order);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1266,4 +1266,6 @@ reads tile \fB\fCinz/inx/iny\fR of \fB\fCin.mvt.gz\fR and produces tile \fB\fCou
|
|||||||
\fB\fC\-j\fR \fIfilter\fP: Filter features using the same expression syntax as in tippecanoe.
|
\fB\fC\-j\fR \fIfilter\fP: Filter features using the same expression syntax as in tippecanoe.
|
||||||
.IP \(bu 2
|
.IP \(bu 2
|
||||||
\fB\fC\-m\fR: If a tile was created with the \fB\fC\-\-retain\-points\-multiplier\fR option, thin the tile back down to its normal feature count during overzooming. The first feature from each cluster will be retained, unless \fB\fC\-j\fR is used to specify a filter, in which case the first matching filter from each cluster will be retained instead.
|
\fB\fC\-m\fR: If a tile was created with the \fB\fC\-\-retain\-points\-multiplier\fR option, thin the tile back down to its normal feature count during overzooming. The first feature from each cluster will be retained, unless \fB\fC\-j\fR is used to specify a filter, in which case the first matching filter from each cluster will be retained instead.
|
||||||
|
.IP \(bu 2
|
||||||
|
\fB\fC\-\-preserve\-input\-order\fR: Restore a set of filtered features to its original input order
|
||||||
.RE
|
.RE
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
#include "protozero/pbf_writer.hpp"
|
#include "protozero/pbf_writer.hpp"
|
||||||
#include "milo/dtoa_milo.h"
|
#include "milo/dtoa_milo.h"
|
||||||
#include "errors.hpp"
|
#include "errors.hpp"
|
||||||
|
#include "serial.hpp"
|
||||||
|
|
||||||
mvt_geometry::mvt_geometry(int nop, long long nx, long long ny) {
|
mvt_geometry::mvt_geometry(int nop, long long nx, long long ny) {
|
||||||
this->op = nop;
|
this->op = nop;
|
||||||
@@ -620,6 +621,11 @@ bool is_unsigned_integer(const char *s, unsigned long long *v) {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This converts a serial_val-style attribute value to an mvt_value
|
||||||
|
// to store in a tile. If the value is numeric, it tries to choose
|
||||||
|
// the type (int, uint, sint, float, or double) that will give the
|
||||||
|
// smallest representation in the tile without losing precision,
|
||||||
|
// regardless of how the value was represented in the original source.
|
||||||
mvt_value stringified_to_mvt_value(int type, const char *s) {
|
mvt_value stringified_to_mvt_value(int type, const char *s) {
|
||||||
mvt_value tv;
|
mvt_value tv;
|
||||||
|
|
||||||
@@ -675,3 +681,43 @@ mvt_value stringified_to_mvt_value(int type, const char *s) {
|
|||||||
|
|
||||||
return tv;
|
return tv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This converts a mvt_value attribute value from a tile back into
|
||||||
|
// a serial_val for more convenient parsing and comparison without
|
||||||
|
// having to handle all of the vector tile numeric types separately.
|
||||||
|
// All numeric types are given the type mvt_double in the serial_val
|
||||||
|
// whether the actual value is integer or floating point.
|
||||||
|
serial_val mvt_value_to_serial_val(mvt_value const &v) {
|
||||||
|
serial_val sv;
|
||||||
|
|
||||||
|
if (v.type == mvt_string) {
|
||||||
|
sv.type = mvt_string;
|
||||||
|
sv.s = v.string_value;
|
||||||
|
} else if (v.type == mvt_float) {
|
||||||
|
sv.type = mvt_double;
|
||||||
|
sv.s = milo::dtoa_milo(v.numeric_value.float_value);
|
||||||
|
} else if (v.type == mvt_double) {
|
||||||
|
sv.type = mvt_double;
|
||||||
|
sv.s = milo::dtoa_milo(v.numeric_value.double_value);
|
||||||
|
} else if (v.type == mvt_int) {
|
||||||
|
sv.type = mvt_double;
|
||||||
|
sv.s = std::to_string(v.numeric_value.int_value);
|
||||||
|
} else if (v.type == mvt_uint) {
|
||||||
|
sv.type = mvt_double;
|
||||||
|
sv.s = std::to_string(v.numeric_value.uint_value);
|
||||||
|
} else if (v.type == mvt_sint) {
|
||||||
|
sv.type = mvt_double;
|
||||||
|
sv.s = std::to_string(v.numeric_value.sint_value);
|
||||||
|
} else if (v.type == mvt_bool) {
|
||||||
|
sv.type = mvt_bool;
|
||||||
|
sv.s = v.numeric_value.bool_value ? "true" : "false";
|
||||||
|
} else if (v.type == mvt_null) {
|
||||||
|
sv.type = mvt_null;
|
||||||
|
sv.s = "null";
|
||||||
|
} else {
|
||||||
|
fprintf(stderr, "unhandled mvt_type %d\n", v.type);
|
||||||
|
exit(EXIT_IMPOSSIBLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
return sv;
|
||||||
|
}
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ struct mvt_feature {
|
|||||||
unsigned long long id = 0;
|
unsigned long long id = 0;
|
||||||
bool has_id = false;
|
bool has_id = false;
|
||||||
bool dropped = false;
|
bool dropped = false;
|
||||||
|
size_t seq = 0; // used for ordering in overzoom
|
||||||
|
|
||||||
mvt_feature() {
|
mvt_feature() {
|
||||||
has_id = false;
|
has_id = false;
|
||||||
@@ -122,4 +123,7 @@ mvt_value stringified_to_mvt_value(int type, const char *s);
|
|||||||
|
|
||||||
bool is_integer(const char *s, long long *v);
|
bool is_integer(const char *s, long long *v);
|
||||||
bool is_unsigned_integer(const char *s, unsigned long long *v);
|
bool is_unsigned_integer(const char *s, unsigned long long *v);
|
||||||
|
|
||||||
|
struct serial_val;
|
||||||
|
serial_val mvt_value_to_serial_val(mvt_value const &v);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+31
-2
@@ -15,6 +15,7 @@ int detail = 12; // tippecanoe-style: mvt extent == 1 << detail
|
|||||||
int buffer = 5; // tippecanoe-style: mvt buffer == extent * buffer / 256;
|
int buffer = 5; // tippecanoe-style: mvt buffer == extent * buffer / 256;
|
||||||
bool demultiply = false;
|
bool demultiply = false;
|
||||||
std::string filter;
|
std::string filter;
|
||||||
|
bool preserve_input_order = false;
|
||||||
|
|
||||||
std::set<std::string> keep;
|
std::set<std::string> keep;
|
||||||
|
|
||||||
@@ -28,7 +29,31 @@ int main(int argc, char **argv) {
|
|||||||
int i;
|
int i;
|
||||||
const char *outfile = NULL;
|
const char *outfile = NULL;
|
||||||
|
|
||||||
while ((i = getopt(argc, argv, "y:d:b:o:mj:")) != -1) {
|
struct option long_options[] = {
|
||||||
|
{"include", required_argument, 0, 'y'},
|
||||||
|
{"full-detail", required_argument, 0, 'd'},
|
||||||
|
{"buffer", required_argument, 0, 'b'},
|
||||||
|
{"output", required_argument, 0, 'o'},
|
||||||
|
{"filter-points-multiplier", no_argument, 0, 'm'},
|
||||||
|
{"feature-filter", required_argument, 0, 'j'},
|
||||||
|
{"preserve-input-order", no_argument, 0, 'o' & 0x1F},
|
||||||
|
|
||||||
|
{0, 0, 0, 0},
|
||||||
|
};
|
||||||
|
|
||||||
|
std::string getopt_str;
|
||||||
|
for (size_t lo = 0; long_options[lo].name != NULL; lo++) {
|
||||||
|
if (long_options[lo].val > ' ') {
|
||||||
|
getopt_str.push_back(long_options[lo].val);
|
||||||
|
|
||||||
|
if (long_options[lo].has_arg == required_argument) {
|
||||||
|
getopt_str.push_back(':');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int option_index = 0;
|
||||||
|
while ((i = getopt_long(argc, argv, getopt_str.c_str(), long_options, &option_index)) != -1) {
|
||||||
switch (i) {
|
switch (i) {
|
||||||
case 'y':
|
case 'y':
|
||||||
keep.insert(optarg);
|
keep.insert(optarg);
|
||||||
@@ -54,6 +79,10 @@ int main(int argc, char **argv) {
|
|||||||
filter = optarg;
|
filter = optarg;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'o' & 0x1F:
|
||||||
|
preserve_input_order = true;
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
fprintf(stderr, "Unrecognized flag -%c\n", i);
|
fprintf(stderr, "Unrecognized flag -%c\n", i);
|
||||||
usage(argv);
|
usage(argv);
|
||||||
@@ -108,7 +137,7 @@ int main(int argc, char **argv) {
|
|||||||
json_filter = parse_filter(filter.c_str());
|
json_filter = parse_filter(filter.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string out = overzoom(tile, oz, ox, oy, nz, nx, ny, detail, buffer, keep, true, NULL, demultiply, json_filter);
|
std::string out = overzoom(tile, oz, ox, oy, nz, nx, ny, detail, buffer, keep, true, NULL, demultiply, json_filter, preserve_input_order);
|
||||||
fwrite(out.c_str(), sizeof(char), out.size(), f);
|
fwrite(out.c_str(), sizeof(char), out.size(), f);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
|
||||||
|
|||||||
@@ -116,6 +116,10 @@ void parse_geometry(int t, json_object *j, drawvec &out, int op, const char *fna
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This is used to convert a JSON attribute value into a serial_val-style
|
||||||
|
// type and stringified value. All numeric values, even if they are integers,
|
||||||
|
// even integers that are too large to fit in a double but will still be
|
||||||
|
// stringified with their original precision, are recorded here as mvt_double.
|
||||||
void stringify_value(json_object *value, int &type, std::string &stringified, const char *reading, int line, json_object *feature) {
|
void stringify_value(json_object *value, int &type, std::string &stringified, const char *reading, int line, json_object *feature) {
|
||||||
if (value != NULL) {
|
if (value != NULL) {
|
||||||
int vt = value->type;
|
int vt = value->type;
|
||||||
|
|||||||
+2
-12
@@ -187,7 +187,6 @@ std::string serialize_feature(serial_feature *sf, long long wx, long long wy) {
|
|||||||
#define FLAG_LAYER 7
|
#define FLAG_LAYER 7
|
||||||
|
|
||||||
#define FLAG_LABEL_POINT 6
|
#define FLAG_LABEL_POINT 6
|
||||||
#define FLAG_SEQ 5
|
|
||||||
#define FLAG_INDEX 4
|
#define FLAG_INDEX 4
|
||||||
#define FLAG_EXTENT 3
|
#define FLAG_EXTENT 3
|
||||||
#define FLAG_ID 2
|
#define FLAG_ID 2
|
||||||
@@ -197,7 +196,6 @@ std::string serialize_feature(serial_feature *sf, long long wx, long long wy) {
|
|||||||
long long layer = 0;
|
long long layer = 0;
|
||||||
layer |= sf->layer << FLAG_LAYER;
|
layer |= sf->layer << FLAG_LAYER;
|
||||||
layer |= (sf->label_point != 0) << FLAG_LABEL_POINT;
|
layer |= (sf->label_point != 0) << FLAG_LABEL_POINT;
|
||||||
layer |= (sf->seq != 0) << FLAG_SEQ;
|
|
||||||
layer |= (sf->index != 0) << FLAG_INDEX;
|
layer |= (sf->index != 0) << FLAG_INDEX;
|
||||||
layer |= (sf->extent != 0) << FLAG_EXTENT;
|
layer |= (sf->extent != 0) << FLAG_EXTENT;
|
||||||
layer |= sf->has_id << FLAG_ID;
|
layer |= sf->has_id << FLAG_ID;
|
||||||
@@ -205,9 +203,7 @@ std::string serialize_feature(serial_feature *sf, long long wx, long long wy) {
|
|||||||
layer |= sf->has_tippecanoe_maxzoom << FLAG_MAXZOOM;
|
layer |= sf->has_tippecanoe_maxzoom << FLAG_MAXZOOM;
|
||||||
|
|
||||||
serialize_long_long(s, layer);
|
serialize_long_long(s, layer);
|
||||||
if (sf->seq != 0) {
|
serialize_long_long(s, sf->seq);
|
||||||
serialize_long_long(s, sf->seq);
|
|
||||||
}
|
|
||||||
if (sf->has_tippecanoe_minzoom) {
|
if (sf->has_tippecanoe_minzoom) {
|
||||||
serialize_int(s, sf->tippecanoe_minzoom);
|
serialize_int(s, sf->tippecanoe_minzoom);
|
||||||
}
|
}
|
||||||
@@ -252,9 +248,7 @@ serial_feature deserialize_feature(std::string &geoms, unsigned z, unsigned tx,
|
|||||||
deserialize_long_long(&cp, &sf.layer);
|
deserialize_long_long(&cp, &sf.layer);
|
||||||
|
|
||||||
sf.seq = 0;
|
sf.seq = 0;
|
||||||
if (sf.layer & (1 << FLAG_SEQ)) {
|
deserialize_long_long(&cp, &sf.seq);
|
||||||
deserialize_long_long(&cp, &sf.seq);
|
|
||||||
}
|
|
||||||
|
|
||||||
sf.tippecanoe_minzoom = -1;
|
sf.tippecanoe_minzoom = -1;
|
||||||
sf.tippecanoe_maxzoom = -1;
|
sf.tippecanoe_maxzoom = -1;
|
||||||
@@ -683,10 +677,6 @@ int serialize_feature(struct serialization_state *sst, serial_feature &sf) {
|
|||||||
*(sst->area_sum) += extent;
|
*(sst->area_sum) += extent;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!prevent[P_INPUT_ORDER]) {
|
|
||||||
sf.seq = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned long long bbox_index;
|
unsigned long long bbox_index;
|
||||||
long long midx, midy;
|
long long midx, midy;
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,10 @@ void deserialize_ulong_long(char **f, unsigned long long *n);
|
|||||||
void deserialize_uint(char **f, unsigned *n);
|
void deserialize_uint(char **f, unsigned *n);
|
||||||
void deserialize_byte(char **f, signed char *n);
|
void deserialize_byte(char **f, signed char *n);
|
||||||
|
|
||||||
|
// This is the main representation of attribute values in memory and
|
||||||
|
// in the string pool. The type is one of the mvt_value type (mvt_string,
|
||||||
|
// mvt_double, mvt_bool, or mvt_null). Note that all numeric values,
|
||||||
|
// whether integer or floating point, use mvt_double here.
|
||||||
struct serial_val {
|
struct serial_val {
|
||||||
int type = 0;
|
int type = 0;
|
||||||
std::string s = "";
|
std::string s = "";
|
||||||
|
|||||||
+11843
-11843
File diff suppressed because it is too large
Load Diff
+17276
-17276
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+144
-144
File diff suppressed because one or more lines are too long
+206
@@ -0,0 +1,206 @@
|
|||||||
|
{ "type": "FeatureCollection", "properties": {
|
||||||
|
"antimeridian_adjusted_bounds": "-175.220564,-41.299973,179.216647,64.150023",
|
||||||
|
"bounds": "-175.220564,-41.299973,179.216647,64.150023",
|
||||||
|
"center": "0.000000,0.000000,0",
|
||||||
|
"description": "tests/ne_110m_populated_places/out/-z0_-r2_-B3_-yNAME_--retain-points-multiplier_3_--order-by_NAME.json.check.mbtiles",
|
||||||
|
"format": "pbf",
|
||||||
|
"generator_options": "./tippecanoe -q -a@ -f -o tests/ne_110m_populated_places/out/-z0_-r2_-B3_-yNAME_--retain-points-multiplier_3_--order-by_NAME.json.check.mbtiles -z0 -r2 -B3 -yNAME --retain-points-multiplier 3 --order-by NAME tests/ne_110m_populated_places/in.json",
|
||||||
|
"json": "{\"vector_layers\":[{\"id\":\"in\",\"description\":\"\",\"minzoom\":0,\"maxzoom\":0,\"fields\":{\"NAME\":\"String\"}}],\"tilestats\":{\"layerCount\":1,\"layers\":[{\"layer\":\"in\",\"count\":243,\"geometry\":\"Point\",\"attributeCount\":1,\"attributes\":[{\"attribute\":\"NAME\",\"count\":243,\"type\":\"string\",\"values\":[\"Abidjan\",\"Abu Dhabi\",\"Abuja\",\"Accra\",\"Addis Ababa\",\"Algiers\",\"Amman\",\"Amsterdam\",\"Andorra\",\"Ankara\",\"Antananarivo\",\"Apia\",\"Ashgabat\",\"Asmara\",\"Astana\",\"Asuncion\",\"Athens\",\"Atlanta\",\"Auckland\",\"Baghdad\",\"Baguio City\",\"Baku\",\"Bamako\",\"Bandar Seri Begawan\",\"Bangalore\",\"Bangkok\",\"Bangui\",\"Banjul\",\"Basseterre\",\"Beijing\",\"Beirut\",\"Belgrade\",\"Belmopan\",\"Berlin\",\"Bern\",\"Bir Lehlou\",\"Bishkek\",\"Bissau\",\"Bloemfontein\",\"Bogota\",\"Brasilia\",\"Bratislava\",\"Brazzaville\",\"Bridgetown\",\"Brussels\",\"Bucharest\",\"Budapest\",\"Buenos Aires\",\"Bujumbura\",\"Cairo\",\"Canberra\",\"Cape Town\",\"Caracas\",\"Casablanca\",\"Castries\",\"Chengdu\",\"Chicago\",\"Chisinau\",\"Colombo\",\"Conakry\",\"Cotonou\",\"Dakar\",\"Damascus\",\"Dar es Salaam\",\"Denver\",\"Dhaka\",\"Dili\",\"Djibouti\",\"Dodoma\",\"Doha\",\"Dubai\",\"Dublin\",\"Dushanbe\",\"Freetown\",\"Funafuti\",\"Gaborone\",\"Geneva\",\"Georgetown\",\"Guatemala\",\"Hanoi\",\"Harare\",\"Hargeysa\",\"Havana\",\"Helsinki\",\"Hong Kong\",\"Honiara\",\"Houston\",\"Islamabad\",\"Istanbul\",\"Jakarta\",\"Jerusalem\",\"Johannesburg\",\"Juba\",\"Kabul\",\"Kampala\",\"Kathmandu\",\"Khartoum\",\"Kiev\",\"Kigali\",\"Kingston\"]}]}]}}",
|
||||||
|
"maxzoom": "0",
|
||||||
|
"minzoom": "0",
|
||||||
|
"name": "tests/ne_110m_populated_places/out/-z0_-r2_-B3_-yNAME_--retain-points-multiplier_3_--order-by_NAME.json.check.mbtiles",
|
||||||
|
"strategies": "[{\"dropped_by_rate\":150}]",
|
||||||
|
"tippecanoe_decisions": "{\"basezoom\":3,\"droprate\":2,\"retain_points_multiplier\":3}",
|
||||||
|
"type": "overlay",
|
||||||
|
"version": "2"
|
||||||
|
}, "features": [
|
||||||
|
{ "type": "FeatureCollection", "properties": { "zoom": 0, "x": 0, "y": 0 }, "features": [
|
||||||
|
{ "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Andorra", "tippecanoe:retain_points_multiplier_sequence": 4, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ 1.494141, 42.488302 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Luxembourg", "tippecanoe:retain_points_multiplier_sequence": 0 }, "geometry": { "type": "Point", "coordinates": [ 6.152344, 49.610710 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Paris", "tippecanoe:retain_points_multiplier_sequence": 89 }, "geometry": { "type": "Point", "coordinates": [ 2.373047, 48.864715 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Astana", "tippecanoe:retain_points_multiplier_sequence": 41, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ 71.455078, 51.179343 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Bishkek", "tippecanoe:retain_points_multiplier_sequence": 29 }, "geometry": { "type": "Point", "coordinates": [ 74.619141, 42.875964 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Tashkent", "tippecanoe:retain_points_multiplier_sequence": 67 }, "geometry": { "type": "Point", "coordinates": [ 69.257812, 41.310824 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Auckland", "tippecanoe:retain_points_multiplier_sequence": 71, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "MultiPoint", "coordinates": [ [ 174.726562, -36.879621 ], [ -185.273438, -36.879621 ] ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Funafuti", "tippecanoe:retain_points_multiplier_sequence": 1 }, "geometry": { "type": "MultiPoint", "coordinates": [ [ 179.208984, -8.494105 ], [ -180.791016, -8.494105 ] ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Suva", "tippecanoe:retain_points_multiplier_sequence": 37 }, "geometry": { "type": "MultiPoint", "coordinates": [ [ 178.417969, -18.145852 ], [ -181.582031, -18.145852 ] ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Bangkok", "tippecanoe:retain_points_multiplier_sequence": 68, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ 100.546875, 13.752725 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Hanoi", "tippecanoe:retain_points_multiplier_sequence": 51 }, "geometry": { "type": "Point", "coordinates": [ 105.820312, 21.043491 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Vientiane", "tippecanoe:retain_points_multiplier_sequence": 42 }, "geometry": { "type": "Point", "coordinates": [ 102.568359, 17.978733 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Beirut", "tippecanoe:retain_points_multiplier_sequence": 40, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ 35.507812, 33.870416 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Cairo", "tippecanoe:retain_points_multiplier_sequence": 87 }, "geometry": { "type": "Point", "coordinates": [ 31.289062, 30.069094 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Tel Aviv-Yafo", "tippecanoe:retain_points_multiplier_sequence": 61 }, "geometry": { "type": "Point", "coordinates": [ 34.804688, 32.101190 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Belmopan", "tippecanoe:retain_points_multiplier_sequence": 44, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ -88.769531, 17.224758 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Nassau", "tippecanoe:retain_points_multiplier_sequence": 50 }, "geometry": { "type": "Point", "coordinates": [ -77.343750, 25.085599 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "New York", "tippecanoe:retain_points_multiplier_sequence": 81 }, "geometry": { "type": "Point", "coordinates": [ -74.003906, 40.780541 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Berlin", "tippecanoe:retain_points_multiplier_sequence": 72, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ 13.359375, 52.536273 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Prague", "tippecanoe:retain_points_multiplier_sequence": 59 }, "geometry": { "type": "Point", "coordinates": [ 14.501953, 50.064192 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Warsaw", "tippecanoe:retain_points_multiplier_sequence": 55 }, "geometry": { "type": "Point", "coordinates": [ 21.005859, 52.268157 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Bir Lehlou", "tippecanoe:retain_points_multiplier_sequence": 3, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ -9.667969, 26.115986 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Dakar", "tippecanoe:retain_points_multiplier_sequence": 70 }, "geometry": { "type": "Point", "coordinates": [ -17.490234, 14.689881 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Nouakchott", "tippecanoe:retain_points_multiplier_sequence": 39 }, "geometry": { "type": "Point", "coordinates": [ -15.996094, 18.062312 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Bratislava", "tippecanoe:retain_points_multiplier_sequence": 7, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ 17.138672, 48.166085 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Budapest", "tippecanoe:retain_points_multiplier_sequence": 52 }, "geometry": { "type": "Point", "coordinates": [ 19.072266, 47.517201 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Rome", "tippecanoe:retain_points_multiplier_sequence": 84 }, "geometry": { "type": "Point", "coordinates": [ 12.480469, 41.902277 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Bridgetown", "tippecanoe:retain_points_multiplier_sequence": 13, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ -59.589844, 13.068777 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Kingstown", "tippecanoe:retain_points_multiplier_sequence": 14 }, "geometry": { "type": "Point", "coordinates": [ -61.171875, 13.154376 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Saint George's", "tippecanoe:retain_points_multiplier_sequence": 15 }, "geometry": { "type": "Point", "coordinates": [ -61.699219, 12.039321 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Bucharest", "tippecanoe:retain_points_multiplier_sequence": 53, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ 26.103516, 44.465151 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Chisinau", "tippecanoe:retain_points_multiplier_sequence": 26 }, "geometry": { "type": "Point", "coordinates": [ 28.828125, 46.980252 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Istanbul", "tippecanoe:retain_points_multiplier_sequence": 83 }, "geometry": { "type": "Point", "coordinates": [ 29.003906, 41.112469 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Chicago", "tippecanoe:retain_points_multiplier_sequence": 65, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ -87.714844, 41.836828 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Guatemala", "tippecanoe:retain_points_multiplier_sequence": 35 }, "geometry": { "type": "Point", "coordinates": [ -90.527344, 14.604847 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Toronto", "tippecanoe:retain_points_multiplier_sequence": 77 }, "geometry": { "type": "Point", "coordinates": [ -79.453125, 43.707594 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Colombo", "tippecanoe:retain_points_multiplier_sequence": 27, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ 79.892578, 6.926427 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Male", "tippecanoe:retain_points_multiplier_sequence": 48 }, "geometry": { "type": "Point", "coordinates": [ 73.476562, 4.127285 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Sri Jawewardenepura Kotte", "tippecanoe:retain_points_multiplier_sequence": 9 }, "geometry": { "type": "Point", "coordinates": [ 79.980469, 6.926427 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Dar es Salaam", "tippecanoe:retain_points_multiplier_sequence": 56, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ 39.287109, -6.839170 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Dodoma", "tippecanoe:retain_points_multiplier_sequence": 10 }, "geometry": { "type": "Point", "coordinates": [ 35.771484, -6.140555 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Nairobi", "tippecanoe:retain_points_multiplier_sequence": 85 }, "geometry": { "type": "Point", "coordinates": [ 36.826172, -1.318243 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Dili", "tippecanoe:retain_points_multiplier_sequence": 19, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ 125.595703, -8.581021 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Jakarta", "tippecanoe:retain_points_multiplier_sequence": 86 }, "geometry": { "type": "Point", "coordinates": [ 106.787109, -6.140555 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Port Moresby", "tippecanoe:retain_points_multiplier_sequence": 25 }, "geometry": { "type": "Point", "coordinates": [ 147.216797, -9.449062 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Doha", "tippecanoe:retain_points_multiplier_sequence": 8, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ 51.503906, 25.324167 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Dubai", "tippecanoe:retain_points_multiplier_sequence": 66 }, "geometry": { "type": "Point", "coordinates": [ 55.283203, 25.244696 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Manama", "tippecanoe:retain_points_multiplier_sequence": 16 }, "geometry": { "type": "Point", "coordinates": [ 50.625000, 26.273714 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Dublin", "tippecanoe:retain_points_multiplier_sequence": 57, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ -6.240234, 53.330873 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "London", "tippecanoe:retain_points_multiplier_sequence": 82 }, "geometry": { "type": "Point", "coordinates": [ -0.087891, 51.508742 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Praia", "tippecanoe:retain_points_multiplier_sequence": 49 }, "geometry": { "type": "Point", "coordinates": [ -23.554688, 14.944785 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Helsinki", "tippecanoe:retain_points_multiplier_sequence": 62, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ 24.960938, 60.196156 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Skopje", "tippecanoe:retain_points_multiplier_sequence": 12 }, "geometry": { "type": "Point", "coordinates": [ 21.445312, 41.967659 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Tallinn", "tippecanoe:retain_points_multiplier_sequence": 34 }, "geometry": { "type": "Point", "coordinates": [ 24.697266, 59.445075 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Hong Kong", "tippecanoe:retain_points_multiplier_sequence": 92, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ 114.169922, 22.268764 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Shanghai", "tippecanoe:retain_points_multiplier_sequence": 88 }, "geometry": { "type": "Point", "coordinates": [ 121.464844, 31.203405 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Taipei", "tippecanoe:retain_points_multiplier_sequence": 79 }, "geometry": { "type": "Point", "coordinates": [ 121.552734, 25.005973 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Islamabad", "tippecanoe:retain_points_multiplier_sequence": 23, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ 73.125000, 33.724340 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Kabul", "tippecanoe:retain_points_multiplier_sequence": 78 }, "geometry": { "type": "Point", "coordinates": [ 69.169922, 34.524661 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "New Delhi", "tippecanoe:retain_points_multiplier_sequence": 75 }, "geometry": { "type": "Point", "coordinates": [ 77.167969, 28.613459 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Juba", "tippecanoe:retain_points_multiplier_sequence": 6, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ 31.552734, 4.828260 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Kampala", "tippecanoe:retain_points_multiplier_sequence": 21 }, "geometry": { "type": "Point", "coordinates": [ 32.607422, 0.351560 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Khartoum", "tippecanoe:retain_points_multiplier_sequence": 54 }, "geometry": { "type": "Point", "coordinates": [ 32.519531, 15.623037 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Kingston", "tippecanoe:retain_points_multiplier_sequence": 31, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ -76.728516, 17.978733 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Port-au-Prince", "tippecanoe:retain_points_multiplier_sequence": 20 }, "geometry": { "type": "Point", "coordinates": [ -72.333984, 18.562947 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Santo Domingo", "tippecanoe:retain_points_multiplier_sequence": 60 }, "geometry": { "type": "Point", "coordinates": [ -69.873047, 18.479609 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Kinshasa", "tippecanoe:retain_points_multiplier_sequence": 74, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ 15.292969, -4.302591 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Luanda", "tippecanoe:retain_points_multiplier_sequence": 63 }, "geometry": { "type": "Point", "coordinates": [ 13.271484, -8.841651 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Windhoek", "tippecanoe:retain_points_multiplier_sequence": 28 }, "geometry": { "type": "Point", "coordinates": [ 17.050781, -22.593726 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Kyoto", "tippecanoe:retain_points_multiplier_sequence": 11, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ 135.791016, 35.029996 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Melekeok", "tippecanoe:retain_points_multiplier_sequence": 2 }, "geometry": { "type": "Point", "coordinates": [ 134.648438, 7.449624 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Osaka", "tippecanoe:retain_points_multiplier_sequence": 73 }, "geometry": { "type": "Point", "coordinates": [ 135.439453, 34.741612 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "La Paz", "tippecanoe:retain_points_multiplier_sequence": 45, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ -68.115234, -16.467695 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Lima", "tippecanoe:retain_points_multiplier_sequence": 69 }, "geometry": { "type": "Point", "coordinates": [ -77.080078, -12.039321 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Valparaiso", "tippecanoe:retain_points_multiplier_sequence": 38 }, "geometry": { "type": "Point", "coordinates": [ -71.630859, -33.063924 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Libreville", "tippecanoe:retain_points_multiplier_sequence": 36, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ 9.492188, 0.351560 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Malabo", "tippecanoe:retain_points_multiplier_sequence": 33 }, "geometry": { "type": "Point", "coordinates": [ 8.789062, 3.776559 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Ndjamena", "tippecanoe:retain_points_multiplier_sequence": 32 }, "geometry": { "type": "Point", "coordinates": [ 15.029297, 12.125264 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Lome", "tippecanoe:retain_points_multiplier_sequence": 18, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ 1.230469, 6.140555 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Niamey", "tippecanoe:retain_points_multiplier_sequence": 22 }, "geometry": { "type": "Point", "coordinates": [ 2.109375, 13.496473 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Valletta", "tippecanoe:retain_points_multiplier_sequence": 47 }, "geometry": { "type": "Point", "coordinates": [ 14.501953, 35.889050 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Los Angeles", "tippecanoe:retain_points_multiplier_sequence": 80, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ -118.212891, 34.016242 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "San Francisco", "tippecanoe:retain_points_multiplier_sequence": 64 }, "geometry": { "type": "Point", "coordinates": [ -122.431641, 37.788081 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Vancouver", "tippecanoe:retain_points_multiplier_sequence": 76 }, "geometry": { "type": "Point", "coordinates": [ -123.134766, 49.267805 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Maseru", "tippecanoe:retain_points_multiplier_sequence": 30, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ 27.509766, -29.305561 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Mbabane", "tippecanoe:retain_points_multiplier_sequence": 5 }, "geometry": { "type": "Point", "coordinates": [ 31.113281, -26.352498 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Pretoria", "tippecanoe:retain_points_multiplier_sequence": 24 }, "geometry": { "type": "Point", "coordinates": [ 28.212891, -25.720735 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Monrovia", "tippecanoe:retain_points_multiplier_sequence": 58, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ -10.810547, 6.315299 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Ouagadougou", "tippecanoe:retain_points_multiplier_sequence": 46 }, "geometry": { "type": "Point", "coordinates": [ -1.494141, 12.382928 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Yamoussoukro", "tippecanoe:retain_points_multiplier_sequence": 43 }, "geometry": { "type": "Point", "coordinates": [ -5.273438, 6.839170 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Montevideo", "tippecanoe:retain_points_multiplier_sequence": 17, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ -56.162109, -34.885931 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Rio de Janeiro", "tippecanoe:retain_points_multiplier_sequence": 90 }, "geometry": { "type": "Point", "coordinates": [ -43.242188, -22.917923 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Sao Paulo", "tippecanoe:retain_points_multiplier_sequence": 91 }, "geometry": { "type": "Point", "coordinates": [ -46.669922, -23.563987 ] } }
|
||||||
|
] }
|
||||||
|
] }
|
||||||
|
] }
|
||||||
+206
@@ -0,0 +1,206 @@
|
|||||||
|
{ "type": "FeatureCollection", "properties": {
|
||||||
|
"antimeridian_adjusted_bounds": "-175.220564,-41.299973,179.216647,64.150023",
|
||||||
|
"bounds": "-175.220564,-41.299973,179.216647,64.150023",
|
||||||
|
"center": "0.000000,0.000000,0",
|
||||||
|
"description": "tests/ne_110m_populated_places/out/-z0_-r2_-B3_-yNAME_--retain-points-multiplier_3_--preserve-input-order.json.check.mbtiles",
|
||||||
|
"format": "pbf",
|
||||||
|
"generator_options": "./tippecanoe -q -a@ -f -o tests/ne_110m_populated_places/out/-z0_-r2_-B3_-yNAME_--retain-points-multiplier_3_--preserve-input-order.json.check.mbtiles -z0 -r2 -B3 -yNAME --retain-points-multiplier 3 --preserve-input-order tests/ne_110m_populated_places/in.json",
|
||||||
|
"json": "{\"vector_layers\":[{\"id\":\"in\",\"description\":\"\",\"minzoom\":0,\"maxzoom\":0,\"fields\":{\"NAME\":\"String\"}}],\"tilestats\":{\"layerCount\":1,\"layers\":[{\"layer\":\"in\",\"count\":243,\"geometry\":\"Point\",\"attributeCount\":1,\"attributes\":[{\"attribute\":\"NAME\",\"count\":243,\"type\":\"string\",\"values\":[\"Abidjan\",\"Abu Dhabi\",\"Abuja\",\"Accra\",\"Addis Ababa\",\"Algiers\",\"Amman\",\"Amsterdam\",\"Andorra\",\"Ankara\",\"Antananarivo\",\"Apia\",\"Ashgabat\",\"Asmara\",\"Astana\",\"Asuncion\",\"Athens\",\"Atlanta\",\"Auckland\",\"Baghdad\",\"Baguio City\",\"Baku\",\"Bamako\",\"Bandar Seri Begawan\",\"Bangalore\",\"Bangkok\",\"Bangui\",\"Banjul\",\"Basseterre\",\"Beijing\",\"Beirut\",\"Belgrade\",\"Belmopan\",\"Berlin\",\"Bern\",\"Bir Lehlou\",\"Bishkek\",\"Bissau\",\"Bloemfontein\",\"Bogota\",\"Brasilia\",\"Bratislava\",\"Brazzaville\",\"Bridgetown\",\"Brussels\",\"Bucharest\",\"Budapest\",\"Buenos Aires\",\"Bujumbura\",\"Cairo\",\"Canberra\",\"Cape Town\",\"Caracas\",\"Casablanca\",\"Castries\",\"Chengdu\",\"Chicago\",\"Chisinau\",\"Colombo\",\"Conakry\",\"Cotonou\",\"Dakar\",\"Damascus\",\"Dar es Salaam\",\"Denver\",\"Dhaka\",\"Dili\",\"Djibouti\",\"Dodoma\",\"Doha\",\"Dubai\",\"Dublin\",\"Dushanbe\",\"Freetown\",\"Funafuti\",\"Gaborone\",\"Geneva\",\"Georgetown\",\"Guatemala\",\"Hanoi\",\"Harare\",\"Hargeysa\",\"Havana\",\"Helsinki\",\"Hong Kong\",\"Honiara\",\"Houston\",\"Islamabad\",\"Istanbul\",\"Jakarta\",\"Jerusalem\",\"Johannesburg\",\"Juba\",\"Kabul\",\"Kampala\",\"Kathmandu\",\"Khartoum\",\"Kiev\",\"Kigali\",\"Kingston\"]}]}]}}",
|
||||||
|
"maxzoom": "0",
|
||||||
|
"minzoom": "0",
|
||||||
|
"name": "tests/ne_110m_populated_places/out/-z0_-r2_-B3_-yNAME_--retain-points-multiplier_3_--preserve-input-order.json.check.mbtiles",
|
||||||
|
"strategies": "[{\"dropped_by_rate\":150}]",
|
||||||
|
"tippecanoe_decisions": "{\"basezoom\":3,\"droprate\":2,\"retain_points_multiplier\":3}",
|
||||||
|
"type": "overlay",
|
||||||
|
"version": "2"
|
||||||
|
}, "features": [
|
||||||
|
{ "type": "FeatureCollection", "properties": { "zoom": 0, "x": 0, "y": 0 }, "features": [
|
||||||
|
{ "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Bir Lehlou", "tippecanoe:retain_points_multiplier_sequence": 3, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ -9.667969, 26.115986 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Dakar", "tippecanoe:retain_points_multiplier_sequence": 70 }, "geometry": { "type": "Point", "coordinates": [ -17.490234, 14.689881 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Nouakchott", "tippecanoe:retain_points_multiplier_sequence": 39 }, "geometry": { "type": "Point", "coordinates": [ -15.996094, 18.062312 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Andorra", "tippecanoe:retain_points_multiplier_sequence": 4, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ 1.494141, 42.488302 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Luxembourg", "tippecanoe:retain_points_multiplier_sequence": 0 }, "geometry": { "type": "Point", "coordinates": [ 6.152344, 49.610710 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Paris", "tippecanoe:retain_points_multiplier_sequence": 89 }, "geometry": { "type": "Point", "coordinates": [ 2.373047, 48.864715 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Juba", "tippecanoe:retain_points_multiplier_sequence": 6, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ 31.552734, 4.828260 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Kampala", "tippecanoe:retain_points_multiplier_sequence": 21 }, "geometry": { "type": "Point", "coordinates": [ 32.607422, 0.351560 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Khartoum", "tippecanoe:retain_points_multiplier_sequence": 54 }, "geometry": { "type": "Point", "coordinates": [ 32.519531, 15.623037 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Bratislava", "tippecanoe:retain_points_multiplier_sequence": 7, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ 17.138672, 48.166085 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Budapest", "tippecanoe:retain_points_multiplier_sequence": 52 }, "geometry": { "type": "Point", "coordinates": [ 19.072266, 47.517201 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Rome", "tippecanoe:retain_points_multiplier_sequence": 84 }, "geometry": { "type": "Point", "coordinates": [ 12.480469, 41.902277 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Doha", "tippecanoe:retain_points_multiplier_sequence": 8, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ 51.503906, 25.324167 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Dubai", "tippecanoe:retain_points_multiplier_sequence": 66 }, "geometry": { "type": "Point", "coordinates": [ 55.283203, 25.244696 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Manama", "tippecanoe:retain_points_multiplier_sequence": 16 }, "geometry": { "type": "Point", "coordinates": [ 50.625000, 26.273714 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Kyoto", "tippecanoe:retain_points_multiplier_sequence": 11, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ 135.791016, 35.029996 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Melekeok", "tippecanoe:retain_points_multiplier_sequence": 2 }, "geometry": { "type": "Point", "coordinates": [ 134.648438, 7.449624 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Osaka", "tippecanoe:retain_points_multiplier_sequence": 73 }, "geometry": { "type": "Point", "coordinates": [ 135.439453, 34.741612 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Bridgetown", "tippecanoe:retain_points_multiplier_sequence": 13, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ -59.589844, 13.068777 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Kingstown", "tippecanoe:retain_points_multiplier_sequence": 14 }, "geometry": { "type": "Point", "coordinates": [ -61.171875, 13.154376 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Saint George's", "tippecanoe:retain_points_multiplier_sequence": 15 }, "geometry": { "type": "Point", "coordinates": [ -61.699219, 12.039321 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Montevideo", "tippecanoe:retain_points_multiplier_sequence": 17, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ -56.162109, -34.885931 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Rio de Janeiro", "tippecanoe:retain_points_multiplier_sequence": 90 }, "geometry": { "type": "Point", "coordinates": [ -43.242188, -22.917923 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Sao Paulo", "tippecanoe:retain_points_multiplier_sequence": 91 }, "geometry": { "type": "Point", "coordinates": [ -46.669922, -23.563987 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Lome", "tippecanoe:retain_points_multiplier_sequence": 18, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ 1.230469, 6.140555 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Niamey", "tippecanoe:retain_points_multiplier_sequence": 22 }, "geometry": { "type": "Point", "coordinates": [ 2.109375, 13.496473 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Valletta", "tippecanoe:retain_points_multiplier_sequence": 47 }, "geometry": { "type": "Point", "coordinates": [ 14.501953, 35.889050 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Dili", "tippecanoe:retain_points_multiplier_sequence": 19, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ 125.595703, -8.581021 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Jakarta", "tippecanoe:retain_points_multiplier_sequence": 86 }, "geometry": { "type": "Point", "coordinates": [ 106.787109, -6.140555 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Port Moresby", "tippecanoe:retain_points_multiplier_sequence": 25 }, "geometry": { "type": "Point", "coordinates": [ 147.216797, -9.449062 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Islamabad", "tippecanoe:retain_points_multiplier_sequence": 23, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ 73.125000, 33.724340 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Kabul", "tippecanoe:retain_points_multiplier_sequence": 78 }, "geometry": { "type": "Point", "coordinates": [ 69.169922, 34.524661 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "New Delhi", "tippecanoe:retain_points_multiplier_sequence": 75 }, "geometry": { "type": "Point", "coordinates": [ 77.167969, 28.613459 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Colombo", "tippecanoe:retain_points_multiplier_sequence": 27, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ 79.892578, 6.926427 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Male", "tippecanoe:retain_points_multiplier_sequence": 48 }, "geometry": { "type": "Point", "coordinates": [ 73.476562, 4.127285 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Sri Jawewardenepura Kotte", "tippecanoe:retain_points_multiplier_sequence": 9 }, "geometry": { "type": "Point", "coordinates": [ 79.980469, 6.926427 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Maseru", "tippecanoe:retain_points_multiplier_sequence": 30, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ 27.509766, -29.305561 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Mbabane", "tippecanoe:retain_points_multiplier_sequence": 5 }, "geometry": { "type": "Point", "coordinates": [ 31.113281, -26.352498 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Pretoria", "tippecanoe:retain_points_multiplier_sequence": 24 }, "geometry": { "type": "Point", "coordinates": [ 28.212891, -25.720735 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Kingston", "tippecanoe:retain_points_multiplier_sequence": 31, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ -76.728516, 17.978733 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Port-au-Prince", "tippecanoe:retain_points_multiplier_sequence": 20 }, "geometry": { "type": "Point", "coordinates": [ -72.333984, 18.562947 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Santo Domingo", "tippecanoe:retain_points_multiplier_sequence": 60 }, "geometry": { "type": "Point", "coordinates": [ -69.873047, 18.479609 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Libreville", "tippecanoe:retain_points_multiplier_sequence": 36, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ 9.492188, 0.351560 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Malabo", "tippecanoe:retain_points_multiplier_sequence": 33 }, "geometry": { "type": "Point", "coordinates": [ 8.789062, 3.776559 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Ndjamena", "tippecanoe:retain_points_multiplier_sequence": 32 }, "geometry": { "type": "Point", "coordinates": [ 15.029297, 12.125264 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Beirut", "tippecanoe:retain_points_multiplier_sequence": 40, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ 35.507812, 33.870416 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Cairo", "tippecanoe:retain_points_multiplier_sequence": 87 }, "geometry": { "type": "Point", "coordinates": [ 31.289062, 30.069094 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Tel Aviv-Yafo", "tippecanoe:retain_points_multiplier_sequence": 61 }, "geometry": { "type": "Point", "coordinates": [ 34.804688, 32.101190 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Astana", "tippecanoe:retain_points_multiplier_sequence": 41, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ 71.455078, 51.179343 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Bishkek", "tippecanoe:retain_points_multiplier_sequence": 29 }, "geometry": { "type": "Point", "coordinates": [ 74.619141, 42.875964 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Tashkent", "tippecanoe:retain_points_multiplier_sequence": 67 }, "geometry": { "type": "Point", "coordinates": [ 69.257812, 41.310824 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Belmopan", "tippecanoe:retain_points_multiplier_sequence": 44, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ -88.769531, 17.224758 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Nassau", "tippecanoe:retain_points_multiplier_sequence": 50 }, "geometry": { "type": "Point", "coordinates": [ -77.343750, 25.085599 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "New York", "tippecanoe:retain_points_multiplier_sequence": 81 }, "geometry": { "type": "Point", "coordinates": [ -74.003906, 40.780541 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "La Paz", "tippecanoe:retain_points_multiplier_sequence": 45, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ -68.115234, -16.467695 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Lima", "tippecanoe:retain_points_multiplier_sequence": 69 }, "geometry": { "type": "Point", "coordinates": [ -77.080078, -12.039321 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Valparaiso", "tippecanoe:retain_points_multiplier_sequence": 38 }, "geometry": { "type": "Point", "coordinates": [ -71.630859, -33.063924 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Bucharest", "tippecanoe:retain_points_multiplier_sequence": 53, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ 26.103516, 44.465151 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Chisinau", "tippecanoe:retain_points_multiplier_sequence": 26 }, "geometry": { "type": "Point", "coordinates": [ 28.828125, 46.980252 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Istanbul", "tippecanoe:retain_points_multiplier_sequence": 83 }, "geometry": { "type": "Point", "coordinates": [ 29.003906, 41.112469 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Dar es Salaam", "tippecanoe:retain_points_multiplier_sequence": 56, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ 39.287109, -6.839170 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Dodoma", "tippecanoe:retain_points_multiplier_sequence": 10 }, "geometry": { "type": "Point", "coordinates": [ 35.771484, -6.140555 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Nairobi", "tippecanoe:retain_points_multiplier_sequence": 85 }, "geometry": { "type": "Point", "coordinates": [ 36.826172, -1.318243 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Dublin", "tippecanoe:retain_points_multiplier_sequence": 57, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ -6.240234, 53.330873 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "London", "tippecanoe:retain_points_multiplier_sequence": 82 }, "geometry": { "type": "Point", "coordinates": [ -0.087891, 51.508742 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Praia", "tippecanoe:retain_points_multiplier_sequence": 49 }, "geometry": { "type": "Point", "coordinates": [ -23.554688, 14.944785 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Monrovia", "tippecanoe:retain_points_multiplier_sequence": 58, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ -10.810547, 6.315299 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Ouagadougou", "tippecanoe:retain_points_multiplier_sequence": 46 }, "geometry": { "type": "Point", "coordinates": [ -1.494141, 12.382928 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Yamoussoukro", "tippecanoe:retain_points_multiplier_sequence": 43 }, "geometry": { "type": "Point", "coordinates": [ -5.273438, 6.839170 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Helsinki", "tippecanoe:retain_points_multiplier_sequence": 62, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ 24.960938, 60.196156 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Skopje", "tippecanoe:retain_points_multiplier_sequence": 12 }, "geometry": { "type": "Point", "coordinates": [ 21.445312, 41.967659 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Tallinn", "tippecanoe:retain_points_multiplier_sequence": 34 }, "geometry": { "type": "Point", "coordinates": [ 24.697266, 59.445075 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Chicago", "tippecanoe:retain_points_multiplier_sequence": 65, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ -87.714844, 41.836828 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Guatemala", "tippecanoe:retain_points_multiplier_sequence": 35 }, "geometry": { "type": "Point", "coordinates": [ -90.527344, 14.604847 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Toronto", "tippecanoe:retain_points_multiplier_sequence": 77 }, "geometry": { "type": "Point", "coordinates": [ -79.453125, 43.707594 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Bangkok", "tippecanoe:retain_points_multiplier_sequence": 68, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ 100.546875, 13.752725 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Hanoi", "tippecanoe:retain_points_multiplier_sequence": 51 }, "geometry": { "type": "Point", "coordinates": [ 105.820312, 21.043491 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Vientiane", "tippecanoe:retain_points_multiplier_sequence": 42 }, "geometry": { "type": "Point", "coordinates": [ 102.568359, 17.978733 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Auckland", "tippecanoe:retain_points_multiplier_sequence": 71, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "MultiPoint", "coordinates": [ [ 174.726562, -36.879621 ], [ -185.273438, -36.879621 ] ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Funafuti", "tippecanoe:retain_points_multiplier_sequence": 1 }, "geometry": { "type": "MultiPoint", "coordinates": [ [ 179.208984, -8.494105 ], [ -180.791016, -8.494105 ] ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Suva", "tippecanoe:retain_points_multiplier_sequence": 37 }, "geometry": { "type": "MultiPoint", "coordinates": [ [ 178.417969, -18.145852 ], [ -181.582031, -18.145852 ] ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Berlin", "tippecanoe:retain_points_multiplier_sequence": 72, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ 13.359375, 52.536273 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Prague", "tippecanoe:retain_points_multiplier_sequence": 59 }, "geometry": { "type": "Point", "coordinates": [ 14.501953, 50.064192 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Warsaw", "tippecanoe:retain_points_multiplier_sequence": 55 }, "geometry": { "type": "Point", "coordinates": [ 21.005859, 52.268157 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Kinshasa", "tippecanoe:retain_points_multiplier_sequence": 74, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ 15.292969, -4.302591 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Luanda", "tippecanoe:retain_points_multiplier_sequence": 63 }, "geometry": { "type": "Point", "coordinates": [ 13.271484, -8.841651 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Windhoek", "tippecanoe:retain_points_multiplier_sequence": 28 }, "geometry": { "type": "Point", "coordinates": [ 17.050781, -22.593726 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Los Angeles", "tippecanoe:retain_points_multiplier_sequence": 80, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ -118.212891, 34.016242 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "San Francisco", "tippecanoe:retain_points_multiplier_sequence": 64 }, "geometry": { "type": "Point", "coordinates": [ -122.431641, 37.788081 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Vancouver", "tippecanoe:retain_points_multiplier_sequence": 76 }, "geometry": { "type": "Point", "coordinates": [ -123.134766, 49.267805 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Hong Kong", "tippecanoe:retain_points_multiplier_sequence": 92, "tippecanoe:retain_points_multiplier_first": true }, "geometry": { "type": "Point", "coordinates": [ 114.169922, 22.268764 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Shanghai", "tippecanoe:retain_points_multiplier_sequence": 88 }, "geometry": { "type": "Point", "coordinates": [ 121.464844, 31.203405 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "NAME": "Taipei", "tippecanoe:retain_points_multiplier_sequence": 79 }, "geometry": { "type": "Point", "coordinates": [ 121.552734, 25.005973 ] } }
|
||||||
|
] }
|
||||||
|
] }
|
||||||
|
] }
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
{ "type": "FeatureCollection", "properties": { "zoom": 0, "x": 0, "y": 0 }, "features": [
|
||||||
|
{ "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [
|
||||||
|
{ "type": "Feature", "properties": { "SCALERANK": 4, "NAME": "Castries" }, "geometry": { "type": "Point", "coordinates": [ -60.996094, 14.008696 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "SCALERANK": 3, "NAME": "Niamey" }, "geometry": { "type": "Point", "coordinates": [ 2.109375, 13.496473 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "SCALERANK": 3, "NAME": "Wellington" }, "geometry": { "type": "MultiPoint", "coordinates": [ [ 174.814453, -41.310824 ], [ -185.273438, -41.310824 ] ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "SCALERANK": 3, "NAME": "Sucre" }, "geometry": { "type": "Point", "coordinates": [ -65.214844, -19.062118 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "SCALERANK": 3, "NAME": "Hargeysa" }, "geometry": { "type": "Point", "coordinates": [ 44.121094, 9.535749 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "SCALERANK": 1, "NAME": "Chengdu" }, "geometry": { "type": "Point", "coordinates": [ 104.062500, 30.675715 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "SCALERANK": 1, "NAME": "Vancouver" }, "geometry": { "type": "Point", "coordinates": [ -123.134766, 49.267805 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "SCALERANK": 1, "NAME": "Vienna" }, "geometry": { "type": "Point", "coordinates": [ 16.347656, 48.166085 ] } }
|
||||||
|
,
|
||||||
|
{ "type": "Feature", "properties": { "SCALERANK": 0, "NAME": "Cape Town" }, "geometry": { "type": "Point", "coordinates": [ 18.457031, -33.943360 ] } }
|
||||||
|
] }
|
||||||
|
] }
|
||||||
Binary file not shown.
+1
-1
@@ -744,7 +744,7 @@ struct tileset_reader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (source.layers.size() != 0) {
|
if (source.layers.size() != 0) {
|
||||||
std::string ret = overzoom(source, parent_tile.z, parent_tile.x, parent_tile.y, tile.z, tile.x, tile.y, -1, buffer, std::set<std::string>(), false, &next_overzoomed_tiles, false, NULL);
|
std::string ret = overzoom(source, parent_tile.z, parent_tile.x, parent_tile.y, tile.z, tile.x, tile.y, -1, buffer, std::set<std::string>(), false, &next_overzoomed_tiles, false, NULL, false);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -111,7 +111,11 @@ struct coalesce {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct preservecmp {
|
static struct preservecmp {
|
||||||
|
bool operator()(const std::vector<struct coalesce> &a, const std::vector<struct coalesce> &b) {
|
||||||
|
return operator()(a[0], b[0]);
|
||||||
|
}
|
||||||
|
|
||||||
bool operator()(const struct coalesce &a, const struct coalesce &b) {
|
bool operator()(const struct coalesce &a, const struct coalesce &b) {
|
||||||
return a.original_seq < b.original_seq;
|
return a.original_seq < b.original_seq;
|
||||||
}
|
}
|
||||||
@@ -303,6 +307,10 @@ static mvt_value coerce_double(mvt_value v) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct ordercmp {
|
struct ordercmp {
|
||||||
|
bool operator()(const std::vector<struct coalesce> &a, const std::vector<struct coalesce> &b) {
|
||||||
|
return operator()(a[0], b[0]);
|
||||||
|
}
|
||||||
|
|
||||||
bool operator()(const struct coalesce &a, const struct coalesce &b) {
|
bool operator()(const struct coalesce &a, const struct coalesce &b) {
|
||||||
for (size_t i = 0; i < order_by.size(); i++) {
|
for (size_t i = 0; i < order_by.size(); i++) {
|
||||||
mvt_value v1 = coerce_double(find_attribute_value(&a, order_by[i].name));
|
mvt_value v1 = coerce_double(find_attribute_value(&a, order_by[i].name));
|
||||||
@@ -331,6 +339,66 @@ struct ordercmp {
|
|||||||
}
|
}
|
||||||
} ordercmp;
|
} ordercmp;
|
||||||
|
|
||||||
|
std::vector<std::vector<coalesce>> assemble_multiplier_clusters(std::vector<coalesce> &features) {
|
||||||
|
std::vector<std::vector<coalesce>> clusters;
|
||||||
|
|
||||||
|
if (retain_points_multiplier == 1) {
|
||||||
|
for (auto const &feature : features) {
|
||||||
|
std::vector<coalesce> cluster;
|
||||||
|
cluster.push_back(feature);
|
||||||
|
clusters.push_back(cluster);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (auto const &feature : features) {
|
||||||
|
bool is_cluster_start = false;
|
||||||
|
|
||||||
|
for (size_t i = 0; i < feature.full_keys.size(); i++) {
|
||||||
|
if (feature.full_keys[i] == "tippecanoe:retain_points_multiplier_first") {
|
||||||
|
is_cluster_start = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is_cluster_start) {
|
||||||
|
clusters.push_back(std::vector<coalesce>());
|
||||||
|
}
|
||||||
|
|
||||||
|
clusters.back().push_back(feature);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return clusters;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<coalesce> disassemble_multiplier_clusters(std::vector<std::vector<coalesce>> &clusters) {
|
||||||
|
std::vector<coalesce> out;
|
||||||
|
|
||||||
|
for (auto &cluster : clusters) {
|
||||||
|
// fix up the attributes so the first feature of the multiplier cluster
|
||||||
|
// gets the marker attribute
|
||||||
|
for (size_t i = 0; i < cluster.size(); i++) {
|
||||||
|
for (size_t j = 0; j < cluster[i].full_keys.size(); j++) {
|
||||||
|
if (cluster[i].full_keys[j] == "tippecanoe:retain_points_multiplier_first") {
|
||||||
|
cluster[0].full_keys.push_back(cluster[i].full_keys[j]);
|
||||||
|
cluster[0].full_values.push_back(cluster[i].full_values[j]);
|
||||||
|
|
||||||
|
cluster[i].full_keys.erase(cluster[i].full_keys.begin() + j);
|
||||||
|
cluster[i].full_values.erase(cluster[i].full_values.begin() + j);
|
||||||
|
|
||||||
|
i = cluster.size(); // break outer
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (auto const &feature : cluster) {
|
||||||
|
out.push_back(feature);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
void rewrite(drawvec &geom, int z, int nextzoom, int maxzoom, long long *bbox, unsigned tx, unsigned ty, int buffer, int *within, std::atomic<long long> *geompos, compressor **geomfile, const char *fname, signed char t, int layer, signed char feature_minzoom, int child_shards, int max_zoom_increment, long long seq, int tippecanoe_minzoom, int tippecanoe_maxzoom, int segment, unsigned *initial_x, unsigned *initial_y, std::vector<long long> &metakeys, std::vector<long long> &metavals, bool has_id, unsigned long long id, unsigned long long index, unsigned long long label_point, long long extent) {
|
void rewrite(drawvec &geom, int z, int nextzoom, int maxzoom, long long *bbox, unsigned tx, unsigned ty, int buffer, int *within, std::atomic<long long> *geompos, compressor **geomfile, const char *fname, signed char t, int layer, signed char feature_minzoom, int child_shards, int max_zoom_increment, long long seq, int tippecanoe_minzoom, int tippecanoe_maxzoom, int segment, unsigned *initial_x, unsigned *initial_y, std::vector<long long> &metakeys, std::vector<long long> &metavals, bool has_id, unsigned long long id, unsigned long long index, unsigned long long label_point, long long extent) {
|
||||||
if (geom.size() > 0 && (nextzoom <= maxzoom || additional[A_EXTEND_ZOOMS] || extend_zooms_max > 0)) {
|
if (geom.size() > 0 && (nextzoom <= maxzoom || additional[A_EXTEND_ZOOMS] || extend_zooms_max > 0)) {
|
||||||
int xo, yo;
|
int xo, yo;
|
||||||
@@ -2379,6 +2447,33 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
|
|||||||
coalesced_area = 0;
|
coalesced_area = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (retain_points_multiplier > 1) {
|
||||||
|
// mapping from input sequence to current sequence within this tile
|
||||||
|
std::vector<std::pair<size_t, size_t>> feature_sequences;
|
||||||
|
|
||||||
|
for (size_t i = 0; i < partials.size(); i++) {
|
||||||
|
feature_sequences.emplace_back(partials[i].original_seq, i);
|
||||||
|
}
|
||||||
|
|
||||||
|
// tag each feature with its sequence number within the tile
|
||||||
|
// if the tile were sorted by input order
|
||||||
|
//
|
||||||
|
// these will be smaller numbers, and avoid the problem of the
|
||||||
|
// original sequence number varying based on how many reader threads
|
||||||
|
// there were reading the input
|
||||||
|
std::sort(feature_sequences.begin(), feature_sequences.end());
|
||||||
|
for (size_t i = 0; i < feature_sequences.size(); i++) {
|
||||||
|
size_t j = feature_sequences[i].second;
|
||||||
|
|
||||||
|
serial_val val;
|
||||||
|
val.type = mvt_double;
|
||||||
|
val.s = std::to_string(i);
|
||||||
|
|
||||||
|
partials[j].full_keys.push_back("tippecanoe:retain_points_multiplier_sequence");
|
||||||
|
partials[j].full_values.push_back(val);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
std::sort(shared_nodes.begin(), shared_nodes.end());
|
std::sort(shared_nodes.begin(), shared_nodes.end());
|
||||||
|
|
||||||
for (size_t i = 0; i < partials.size(); i++) {
|
for (size_t i = 0; i < partials.size(); i++) {
|
||||||
@@ -2629,11 +2724,21 @@ long long write_tile(decompressor *geoms, std::atomic<long long> *geompos_in, ch
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (prevent[P_INPUT_ORDER]) {
|
if (prevent[P_INPUT_ORDER]) {
|
||||||
std::sort(layer_features.begin(), layer_features.end(), preservecmp);
|
auto clustered = assemble_multiplier_clusters(layer_features);
|
||||||
|
for (auto &c : clustered) {
|
||||||
|
std::sort(c.begin(), c.end());
|
||||||
|
}
|
||||||
|
std::sort(clustered.begin(), clustered.end(), preservecmp);
|
||||||
|
layer_features = disassemble_multiplier_clusters(clustered);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (order_by.size() != 0) {
|
if (order_by.size() != 0) {
|
||||||
std::sort(layer_features.begin(), layer_features.end(), ordercmp);
|
auto clustered = assemble_multiplier_clusters(layer_features);
|
||||||
|
for (auto &c : clustered) {
|
||||||
|
std::sort(c.begin(), c.end());
|
||||||
|
}
|
||||||
|
std::sort(clustered.begin(), clustered.end(), ordercmp);
|
||||||
|
layer_features = disassemble_multiplier_clusters(clustered);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (z == maxzoom && limit_tile_feature_count_at_maxzoom != 0) {
|
if (z == maxzoom && limit_tile_feature_count_at_maxzoom != 0) {
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
#ifndef VERSION_HPP
|
#ifndef VERSION_HPP
|
||||||
#define VERSION_HPP
|
#define VERSION_HPP
|
||||||
|
|
||||||
#define VERSION "v2.41.0"
|
#define VERSION "v2.41.1"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user