mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-05 09:55:41 +02:00
Ah, I was not actually storing the representative point
This commit is contained in:
@@ -775,8 +775,12 @@ int serialize_feature(struct serialization_state *sst, serial_feature &sf, std::
|
|||||||
preserve_multiplier_density_threshold > 0 ||
|
preserve_multiplier_density_threshold > 0 ||
|
||||||
cluster_distance != 0) {
|
cluster_distance != 0) {
|
||||||
sf.index = bbox_index;
|
sf.index = bbox_index;
|
||||||
|
sf.wx = midx;
|
||||||
|
sf.wy = midy;
|
||||||
} else {
|
} else {
|
||||||
sf.index = 0;
|
sf.index = 0;
|
||||||
|
sf.wx = 0;
|
||||||
|
sf.wy = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sst->layermap->count(layername) == 0) {
|
if (sst->layermap->count(layername) == 0) {
|
||||||
|
|||||||
@@ -1059,6 +1059,7 @@ static bool skip_next_feature(decompressor *geoms, std::atomic<long long> *geomp
|
|||||||
|
|
||||||
struct next_feature_state {
|
struct next_feature_state {
|
||||||
unsigned long long previndex = 0;
|
unsigned long long previndex = 0;
|
||||||
|
unsigned prevx = 0, prevy = 0;
|
||||||
unsigned long long prev_not_dropped_index = 0;
|
unsigned long long prev_not_dropped_index = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1128,8 +1129,8 @@ static serial_feature next_feature(decompressor *geoms, std::atomic<long long> *
|
|||||||
long long ox = (1LL << (32 - z)) * tx;
|
long long ox = (1LL << (32 - z)) * tx;
|
||||||
long long oy = (1LL << (32 - z)) * ty;
|
long long oy = (1LL << (32 - z)) * ty;
|
||||||
|
|
||||||
unsigned wx1, wy1;
|
unsigned wx1 = next_feature_state.prevx;
|
||||||
decode_index(next_feature_state.previndex, &wx1, &wy1);
|
unsigned wy1 = next_feature_state.prevy;
|
||||||
|
|
||||||
// find the furthest distance of a vertex in this feature
|
// find the furthest distance of a vertex in this feature
|
||||||
// from the representative point of the previous feature
|
// from the representative point of the previous feature
|
||||||
@@ -1145,6 +1146,8 @@ static serial_feature next_feature(decompressor *geoms, std::atomic<long long> *
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
next_feature_state.previndex = sf.index;
|
next_feature_state.previndex = sf.index;
|
||||||
|
next_feature_state.prevx = sf.wx;
|
||||||
|
next_feature_state.prevy = sf.wy;
|
||||||
|
|
||||||
if (clip_to_tile(sf, z, buffer)) {
|
if (clip_to_tile(sf, z, buffer)) {
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user