Merge branch 'master' into earcut-polygon

Conflicts:
	tile.cc
This commit is contained in:
Eric Fischer
2016-04-26 12:09:56 -07:00
18 changed files with 6701 additions and 17 deletions
+13 -2
View File
@@ -909,6 +909,15 @@ int quick_check(long long *bbox, int z, int detail, long long buffer) {
return 2;
}
bool point_within_tile(long long x, long long y, int z, int detail, long long buffer) {
// No adjustment for buffer, because the point must be
// strictly within the tile to appear exactly once
long long area = 1LL << (32 - z);
return x >= 0 && y >= 0 && x < area && y < area;
}
drawvec clip_lines(drawvec &geom, int z, int detail, long long buffer) {
drawvec out;
@@ -1061,7 +1070,7 @@ drawvec impose_tile_boundaries(drawvec &geom, long long extent) {
return out;
}
drawvec simplify_lines(drawvec &geom, int z, int detail) {
drawvec simplify_lines(drawvec &geom, int z, int detail, bool mark_tile_bounds) {
int res = 1 << (32 - detail - z);
long long area = 0xFFFFFFFF;
if (z != 0) {
@@ -1078,7 +1087,9 @@ drawvec simplify_lines(drawvec &geom, int z, int detail) {
}
}
geom = impose_tile_boundaries(geom, area);
if (mark_tile_bounds) {
geom = impose_tile_boundaries(geom, area);
}
for (size_t i = 0; i < geom.size(); i++) {
if (geom[i].op == VT_MOVETO) {