Merge pull request #328 from mapbox/grid-snap-rounding

Round coordinates in low-zoom grid instead of truncating
This commit is contained in:
Eric Fischer 2016-11-30 14:31:23 -08:00 committed by GitHub
commit afa782fb7f
4 changed files with 995 additions and 980 deletions

View File

@ -1,3 +1,7 @@
## 1.15.3
* Round coordinates in low-zoom grid math instead of truncating
## 1.15.2
* Add --grid-low-zooms option to snap low-zoom features to the tile grid

View File

@ -1302,10 +1302,11 @@ static int clip(double *x0, double *y0, double *x1, double *y1, double xmin, dou
drawvec stairstep(drawvec &geom, int z, int detail) {
drawvec out;
double scale = 1 << (32 - detail - z);
for (size_t i = 0; i < geom.size(); i++) {
geom[i].x >>= (32 - detail - z);
geom[i].y >>= (32 - detail - z);
geom[i].x = std::round(geom[i].x / scale);
geom[i].y = std::round(geom[i].y / scale);
}
for (size_t i = 0; i < geom.size(); i++) {

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
#define VERSION "tippecanoe v1.15.2\n"
#define VERSION "tippecanoe v1.15.3\n"