mirror of
https://github.com/felt/tippecanoe.git
synced 2026-11-26 18:31:17 +01:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
84f6e887a7 |
@@ -1,3 +1,7 @@
|
||||
# 2.62.1
|
||||
|
||||
* More work in progress on binning point features in overzoom
|
||||
|
||||
# 2.62.0
|
||||
|
||||
* Fix another bad interaction, this time between dropping-as-needed and --limit-tile-feature-count
|
||||
|
||||
+1
-1
@@ -82,7 +82,7 @@ std::vector<mvt_layer> parse_layers(int fd, int z, unsigned x, unsigned y, std::
|
||||
exit(EXIT_OPEN);
|
||||
}
|
||||
|
||||
std::vector<mvt_layer> out = parse_layers(f, z, x, y, extent, true);
|
||||
std::vector<mvt_layer> out = parse_layers(f, z, x, y, extent, false);
|
||||
|
||||
if (fclose(f) != 0) {
|
||||
perror("fclose postfilter output");
|
||||
|
||||
+44
-19
@@ -278,38 +278,62 @@ std::vector<mvt_layer> parse_layers(FILE *fp, int z, unsigned x, unsigned y, int
|
||||
|
||||
drawvec dv;
|
||||
parse_geometry(t, coordinates, dv, VT_MOVETO, "Filter output", jp->line, j);
|
||||
if (mb_geometry[t] == VT_POLYGON) {
|
||||
dv = fix_polygon(dv, false, false);
|
||||
}
|
||||
|
||||
// handle longitude wraparound
|
||||
//
|
||||
// this is supposed to be data for a single tile,
|
||||
// so any jump from the left hand side of the world
|
||||
// to the right side, or vice versa, is unexpected,
|
||||
// so any jump from the left hand side edge of the world
|
||||
// to the right edge, or vice versa, is unexpected,
|
||||
// so move it to the other side.
|
||||
//
|
||||
// (unless this is z0, in which case it is still
|
||||
// reasonable to have a big, world-spanning polygon,
|
||||
// and I'm not sure what to do about that.)
|
||||
|
||||
if (fix_longitudes) {
|
||||
if (fix_longitudes && mb_geometry[t] == VT_POLYGON) {
|
||||
const long long quarter_world = 1LL << 30;
|
||||
const long long world = 1LL << 32;
|
||||
|
||||
bool copy_to_left = false;
|
||||
bool copy_to_right = false;
|
||||
|
||||
for (size_t i = 0; i < dv.size(); i++) {
|
||||
// is this vertex on a different side of the world
|
||||
// than the first vertex? then shift this one to match
|
||||
if (i > 0) {
|
||||
if ((dv[0].x < (1LL << 30)) &&
|
||||
(dv[i].x > 3 * (1LL << 30))) {
|
||||
dv[i].x -= 1LL << 32;
|
||||
if ((dv[0].x < quarter_world) && (dv[i].x > 3 * quarter_world)) {
|
||||
dv[i].x -= world;
|
||||
}
|
||||
if ((dv[0].x > 3 * (1LL << 30)) &&
|
||||
(dv[i].x < (1LL << 30))) {
|
||||
dv[i].x += 1LL << 32;
|
||||
if ((dv[0].x > 3 * quarter_world) && (dv[i].x < quarter_world)) {
|
||||
dv[i].x += world;
|
||||
}
|
||||
}
|
||||
|
||||
// does it stick off the edge of the world?
|
||||
// then we need another copy on the other side of the world
|
||||
if (dv[i].x < 0) {
|
||||
copy_to_right = true;
|
||||
}
|
||||
if (dv[i].x > world) {
|
||||
copy_to_left = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (copy_to_left) {
|
||||
size_t n = dv.size();
|
||||
for (size_t i = 0; i < n; i++) {
|
||||
dv.emplace_back(dv[i].op, dv[i].x - world, (long long) dv[i].y);
|
||||
}
|
||||
}
|
||||
if (copy_to_right) {
|
||||
size_t n = dv.size();
|
||||
for (size_t i = 0; i < n; i++) {
|
||||
dv.emplace_back(dv[i].op, dv[i].x + world, (long long) dv[i].y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Offset and scale geometry from global to tile
|
||||
if (mb_geometry[t] == VT_POLYGON) {
|
||||
dv = fix_polygon(dv, false, false);
|
||||
}
|
||||
|
||||
// Offset and scale geometry from global to tile
|
||||
for (size_t i = 0; i < dv.size(); i++) {
|
||||
long long scale = 1LL << (32 - z);
|
||||
|
||||
@@ -323,8 +347,9 @@ std::vector<mvt_layer> parse_layers(FILE *fp, int z, unsigned x, unsigned y, int
|
||||
}
|
||||
|
||||
if (mb_geometry[t] == VT_POLYGON) {
|
||||
// we can try scaling up because these are tile coordinates
|
||||
dv = clean_or_clip_poly(dv, 0, 0, false, true);
|
||||
// don't try scaling up because we may have coordinates
|
||||
// on the other side of the world
|
||||
dv = clean_or_clip_poly(dv, z, 256, true, false);
|
||||
if (dv.size() < 3) {
|
||||
dv.clear();
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
-1
@@ -1,6 +1,6 @@
|
||||
#ifndef VERSION_HPP
|
||||
#define VERSION_HPP
|
||||
|
||||
#define VERSION "v2.62.0"
|
||||
#define VERSION "v2.62.1"
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user