From 7aa27b7f4c6688f18891ef4171519c1e3b9c182a Mon Sep 17 00:00:00 2001 From: Eric Fischer Date: Wed, 20 Jan 2016 13:58:17 -0800 Subject: [PATCH 1/2] Make calculation of child tile overlap match clipping behavior. Coordinates that are right on the tile boundary appear in both adjacent tiles. Make tippecanoe-decode also use exact edge coordinates instead of half-pixel locations. --- decode.cc | 4 ++-- tile.cc | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/decode.cc b/decode.cc index b5c77b3..d744f25 100644 --- a/decode.cc +++ b/decode.cc @@ -194,8 +194,8 @@ void handle(std::string message, int z, unsigned x, unsigned y, int describe) { g += 2; long long scale = 1LL << (32 - z); - long long wx = scale * x + (scale / extent) * (px + .5); - long long wy = scale * y + (scale / extent) * (py + .5); + long long wx = scale * x + (scale / extent) * px; + long long wy = scale * y + (scale / extent) * py; double lat, lon; tile2latlon(wx, wy, 32, &lat, &lon); diff --git a/tile.cc b/tile.cc index 0e19cb7..8c3f255 100644 --- a/tile.cc +++ b/tile.cc @@ -376,8 +376,10 @@ void rewrite(drawvec &geom, int z, int nextzoom, int maxzoom, long long *bbox, u // Division instead of right-shift because coordinates can be negative bbox2[k] = bbox[k] / (1 << (32 - nextzoom - 8)); } - bbox2[0] -= buffer; - bbox2[1] -= buffer; + // Decrement the top and left edges so that any features that are + // touching the edge can potentially be included in the adjacent tiles too. + bbox2[0] -= buffer + 1; + bbox2[1] -= buffer + 1; bbox2[2] += buffer; bbox2[3] += buffer; From 160257464763061b8f03a85237526548ea3aba91 Mon Sep 17 00:00:00 2001 From: Eric Fischer Date: Wed, 20 Jan 2016 14:53:58 -0800 Subject: [PATCH 2/2] Bump version number --- CHANGELOG.md | 5 +++++ version.h | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 304ebcc..4757d7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 1.7.1 + +* Make clipping behavior with no buffer consistent with Mapnik. + Features that are exactly on a tile boundary appear in both tiles. + ## 1.7.0 * Parallel processing of input with -P works with streamed input too diff --git a/version.h b/version.h index 2c7c8d7..d7ec1c3 100644 --- a/version.h +++ b/version.h @@ -1 +1 @@ -#define VERSION "tippecanoe v1.7.0\n" +#define VERSION "tippecanoe v1.7.1\n"