mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-02 08:25:40 +02:00
Round coordinates in low-zoom grid instead of truncating
To avoid rounding error if features are already tile-grid-aligned
This commit is contained in:
@@ -1,3 +1,7 @@
|
|||||||
|
## 1.15.3
|
||||||
|
|
||||||
|
* Round coordinates in low-zoom grid math instead of truncating
|
||||||
|
|
||||||
## 1.15.2
|
## 1.15.2
|
||||||
|
|
||||||
* Add --grid-low-zooms option to snap low-zoom features to the tile grid
|
* Add --grid-low-zooms option to snap low-zoom features to the tile grid
|
||||||
|
|||||||
+3
-2
@@ -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 stairstep(drawvec &geom, int z, int detail) {
|
||||||
drawvec out;
|
drawvec out;
|
||||||
|
double scale = 1 << (32 - detail - z);
|
||||||
|
|
||||||
for (size_t i = 0; i < geom.size(); i++) {
|
for (size_t i = 0; i < geom.size(); i++) {
|
||||||
geom[i].x >>= (32 - detail - z);
|
geom[i].x = std::round(geom[i].x / scale);
|
||||||
geom[i].y >>= (32 - detail - z);
|
geom[i].y = std::round(geom[i].y / scale);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (size_t i = 0; i < geom.size(); i++) {
|
for (size_t i = 0; i < geom.size(); i++) {
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
+1
-1
@@ -1 +1 @@
|
|||||||
#define VERSION "tippecanoe v1.15.2\n"
|
#define VERSION "tippecanoe v1.15.3\n"
|
||||||
|
|||||||
Reference in New Issue
Block a user