From 93d3c4059373377822ffe5601cd21cea18ef3709 Mon Sep 17 00:00:00 2001 From: Eric Fischer Date: Wed, 26 Oct 2016 15:42:52 -0700 Subject: [PATCH] Remove dead code --- geojson.cpp | 30 +----------------------------- geometry.cpp | 4 ---- 2 files changed, 1 insertion(+), 33 deletions(-) diff --git a/geojson.cpp b/geojson.cpp index fdf4474..3c2b91e 100644 --- a/geojson.cpp +++ b/geojson.cpp @@ -350,34 +350,6 @@ int serialize_geometry(json_object *geometry, json_object *properties, json_obje } } - /* - * Note that feature_minzoom for lines is the dimension - * of the geometry in world coordinates, but - * for points is the lowest zoom level (in tiles, - * not in pixels) at which it should be drawn. - * - * So a line that is too small for, say, z8 - * will have feature_minzoom of 18 (if tile detail is 10), - * not 8. - */ - int feature_minzoom = 0; - if (mb_geometry[t] == VT_LINE) { - // Skip z0 check because everything is always in the one z0 tile - for (feature_minzoom = 1; feature_minzoom < 31; feature_minzoom++) { - unsigned mask = 1 << (32 - (feature_minzoom + 1)); - - if (((bbox[0] & mask) != (bbox[2] & mask)) || ((bbox[1] & mask) != (bbox[3] & mask))) { - break; - } - } - } else if (mb_geometry[t] == VT_POINT) { - double r = ((double) rand()) / RAND_MAX; - if (r == 0) { - r = .00000001; - } - feature_minzoom = basezoom - floor(log(r) / -log(droprate)); - } - if (tippecanoe_layername.size() != 0) { if (layermap->count(tippecanoe_layername) == 0) { layermap->insert(std::pair(tippecanoe_layername, layermap_entry(layermap->size()))); @@ -407,7 +379,7 @@ int serialize_geometry(json_object *geometry, json_object *properties, json_obje sf.tippecanoe_maxzoom = tippecanoe_maxzoom; sf.geometry = dv; sf.m = m; - sf.feature_minzoom = feature_minzoom; + sf.feature_minzoom = 0; // Will be filled in during index merging if (inline_meta) { sf.metapos = -1; diff --git a/geometry.cpp b/geometry.cpp index bd23f0f..89cf541 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -648,19 +648,15 @@ static draw intersect(draw a, draw b, int edge, long long minx, long long miny, switch (edge) { case 0: // top return draw(VT_LINETO, a.x + (double) (b.x - a.x) * (miny - a.y) / (b.y - a.y), miny); - break; case 1: // right return draw(VT_LINETO, maxx, a.y + (double) (b.y - a.y) * (maxx - a.x) / (b.x - a.x)); - break; case 2: // bottom return draw(VT_LINETO, a.x + (double) (b.x - a.x) * (maxy - a.y) / (b.y - a.y), maxy); - break; case 3: // left return draw(VT_LINETO, minx, a.y + (double) (b.y - a.y) * (minx - a.x) / (b.x - a.x)); - break; } fprintf(stderr, "internal error intersecting\n");