From 082487b594f0eee4a6a5d6639494405f9402c1e9 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 1 Dec 2026 01:11:29 +0000 Subject: [PATCH] With -pn, give area covered by more than one polygon to the earliest Consistent snapping keeps the borders of polygons in a layer from crossing, but where rounding turned a narrow polygon between two others inside out (for example, a Census block thinner than a pixel whose two sides cross when rounded to tile coordinates), the area it covered is covered by both of its neighbors, and snapping can't decide which of them it belongs to. So after cleaning the polygons of each layer, find the ones that overlap: two polygons that share an edge in the same direction both cover the area beside it (neighbors that tile exactly traverse their shared border in opposite directions), and where their borders don't share any edges, a vertex of one is strictly inside the other. Then remove each overlapping area from all but the polygon with the lowest sequence number, using the layer's hot pixels so the result stays consistent with the rest. For Dane County Census blocks at -D8 -d8 -pt -pn, this reduces the overlapping pixels at z8, z9, and z10 from 41, 61, and 61 to 7, 8, and 16, without changing the gaps much or taking noticeably longer, and with no self-intersecting polygons. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01CQ6vQUJtmGZnqz7RmVYQaJ --- CHANGELOG.md | 7 +- polygon.cpp | 197 ++++++++++++++++++ polygon.hpp | 9 + ...e_--no-simplification-of-shared-nodes.json | 4 +- tests/spindle-shared/out/-z7_-pn.json | 8 +- tile.cpp | 23 ++ unit.cpp | 37 ++++ 7 files changed, 278 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 03372086..b38770fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,7 +48,12 @@ [x - 0.5, x + 0.5) by [y - 0.5, y + 0.5), as in Hobby's snap rounding, rather than as closed squares, because edges passing diagonally through pixel corners otherwise zigzagged through the same pixels in different - orders in different polygons, and could cross each other. For Dane County Census blocks at -D8 -d8 -pt -pn, this + orders in different polygons, and could cross each other. Then, where + rounding turned a narrow polygon between two others inside out, so that the + area it covered is covered by both of its neighbors, that area is removed + from all but the earliest of them. These overlaps are found from edges that + two polygons share in the same direction, which neighbors that tile exactly + never do, and from vertices of one polygon strictly inside another. For Dane County Census blocks at -D8 -d8 -pt -pn, this reduces the gaps between blocks at z9 and z10 from 55 and 155 pixels to 13 and 23, and the overlaps from 113 and 175 to 56 and 59, and takes about 7% longer for Natural Earth countries at -z8 -pn. diff --git a/polygon.cpp b/polygon.cpp index 2c876604..810ff775 100644 --- a/polygon.cpp +++ b/polygon.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -668,3 +669,199 @@ drawvec clean_polygon_with_hot_pixels(drawvec const &geom, hot_pixel_list const *ok = wagyu_union(geom, NULL, 1, out, false, &hot); return out; } + +namespace { +struct directed_edge { + long long ax, ay, bx, by; + + bool operator==(directed_edge const &o) const { + return ax == o.ax && ay == o.ay && bx == o.bx && by == o.by; + } +}; + +struct directed_edge_hash { + size_t operator()(directed_edge const &e) const { + size_t h = std::hash()(e.ax); + h = h * 1000003 ^ std::hash()(e.ay); + h = h * 1000003 ^ std::hash()(e.bx); + h = h * 1000003 ^ std::hash()(e.by); + return h; + } +}; + +template +void for_each_edge(drawvec const &geom, F f) { + for (size_t i = 0; i < geom.size(); i++) { + if (geom[i].op == VT_MOVETO) { + size_t j; + for (j = i + 1; j < geom.size(); j++) { + if (geom[j].op != VT_LINETO) { + break; + } + } + for (size_t k = i; k + 1 < j; k++) { + if (geom[k].x != geom[k + 1].x || geom[k].y != geom[k + 1].y) { + f(directed_edge{geom[k].x, geom[k].y, geom[k + 1].x, geom[k + 1].y}); + } + } + i = j - 1; + } + } +} +} // namespace + +// Whether the point (px, py) is strictly inside the polygon `geom` by the +// nonzero winding rule, with exact integer arithmetic. A point exactly on the +// polygon's boundary does not count as inside. +static bool strictly_inside(drawvec const &geom, long long px, long long py) { + int wn = 0; + for (size_t i = 0; i < geom.size(); i++) { + if (geom[i].op == VT_MOVETO) { + size_t j; + for (j = i + 1; j < geom.size(); j++) { + if (geom[j].op != VT_LINETO) { + break; + } + } + for (size_t k = i; k + 1 < j; k++) { + long long x1 = geom[k].x, y1 = geom[k].y, x2 = geom[k + 1].x, y2 = geom[k + 1].y; + long long cross = (x2 - x1) * (py - y1) - (px - x1) * (y2 - y1); + if (cross == 0 && std::min(x1, x2) <= px && px <= std::max(x1, x2) && std::min(y1, y2) <= py && py <= std::max(y1, y2)) { + return false; // on the boundary + } + if (y1 <= py) { + if (y2 > py && cross > 0) { + wn++; + } + } else { + if (y2 <= py && cross < 0) { + wn--; + } + } + } + i = j - 1; + } + } + return wn != 0; +} + +size_t remove_overlaps(std::vector const &geoms, hot_pixel_list const *hot) { + // Which polygon (the earliest) each directed edge is part of. Cleaned rings + // all have their polygon's interior on the same side, so two polygons that + // tile exactly traverse the border they share in opposite directions, and + // two polygons that share an edge in the same direction both cover the area + // beside it. With consistent snapping, edges of different polygons don't + // cross, so this is where overlaps between them show up. + std::unordered_map owner; + std::vector> overlaps(geoms.size()); + + for (size_t i = 0; i < geoms.size(); i++) { + for_each_edge(*geoms[i], [&](directed_edge const &e) { + auto found = owner.find(e); + if (found == owner.end()) { + owner.emplace(e, i); + } else if (found->second != i) { + std::vector &o = overlaps[i]; + if (std::find(o.begin(), o.end(), found->second) == o.end()) { + o.push_back(found->second); + } + } + }); + } + + // Where the polygons' boundaries don't share any edges where they overlap, + // one of them has a vertex that is strictly inside the other. + { + const long long cell = 16; + std::vector minx(geoms.size()), miny(geoms.size()), maxx(geoms.size()), maxy(geoms.size()); + std::unordered_map> grid; + auto key = [](long long cx, long long cy) { + return (cx << 32) ^ (cy & 0xFFFFFFFF); + }; + for (size_t i = 0; i < geoms.size(); i++) { + minx[i] = miny[i] = LLONG_MAX; + maxx[i] = maxy[i] = LLONG_MIN; + for (auto const &d : *geoms[i]) { + minx[i] = std::min(minx[i], (long long) d.x); + miny[i] = std::min(miny[i], (long long) d.y); + maxx[i] = std::max(maxx[i], (long long) d.x); + maxy[i] = std::max(maxy[i], (long long) d.y); + } + if (geoms[i]->size() == 0) { + continue; + } + for (long long cx = std::floor(minx[i] / (double) cell); cx <= std::floor(maxx[i] / (double) cell); cx++) { + for (long long cy = std::floor(miny[i] / (double) cell); cy <= std::floor(maxy[i] / (double) cell); cy++) { + grid[key(cx, cy)].push_back(i); + } + } + } + + for (size_t i = 0; i < geoms.size(); i++) { + for (auto const &d : *geoms[i]) { + auto found = grid.find(key(std::floor(d.x / (double) cell), std::floor(d.y / (double) cell))); + if (found == grid.end()) { + continue; + } + for (size_t j : found->second) { + if (j == i || d.x < minx[j] || d.x > maxx[j] || d.y < miny[j] || d.y > maxy[j]) { + continue; + } + size_t later = std::max(i, j), earlier = std::min(i, j); + std::vector &o = overlaps[later]; + if (std::find(o.begin(), o.end(), earlier) != o.end()) { + continue; + } + if (strictly_inside(*geoms[j], d.x, d.y)) { + o.push_back(earlier); + } + } + } + } + } + + size_t changed = 0; + for (size_t i = 0; i < geoms.size(); i++) { + if (overlaps[i].size() == 0) { + continue; + } + + mapbox::geometry::multi_polygon result; + try { + mapbox::geometry::wagyu::wagyu wagyu; + add_rings(wagyu, *geoms[i], mapbox::geometry::wagyu::polygon_type_subject, 1); + drawvec all = *geoms[i]; + for (size_t earlier : overlaps[i]) { + add_rings(wagyu, *geoms[earlier], mapbox::geometry::wagyu::polygon_type_clip, 1); + all.insert(all.end(), geoms[earlier]->begin(), geoms[earlier]->end()); + } + // Snap the same way as the polygons were cleaned, so the result + // stays consistent with them. + if (hot != NULL) { + std::vector> near = hot_pixels_near(all, *hot); + if (near.size() > 0) { + wagyu.add_hot_pixels(near); + } + } + wagyu.execute(mapbox::geometry::wagyu::clip_type_difference, result, mapbox::geometry::wagyu::fill_type_positive, mapbox::geometry::wagyu::fill_type_positive); + } catch (std::runtime_error &e) { + continue; + } + + drawvec out; + for (auto const &poly : result) { + for (auto const &ring : poly) { + for (size_t k = 0; k < ring.size(); k++) { + out.emplace_back(k == 0 ? VT_MOVETO : VT_LINETO, ring[k].x, ring[k].y); + } + if (ring.size() > 0 && (ring.front().x != ring.back().x || ring.front().y != ring.back().y)) { + out.emplace_back(VT_LINETO, ring.front().x, ring.front().y); + } + } + } + *geoms[i] = std::move(out); + changed++; + } + + return changed; +} diff --git a/polygon.hpp b/polygon.hpp index 481e2fe1..bf54746c 100644 --- a/polygon.hpp +++ b/polygon.hpp @@ -57,4 +57,13 @@ hot_pixel_list layer_hot_pixels(std::vector const &geoms); // from layer_hot_pixels() as well as its own. Sets *ok to false if that fails. drawvec clean_polygon_with_hot_pixels(drawvec const &geom, hot_pixel_list const &hot, bool *ok); +// Polygons (in tile coordinates, in order of priority) that have been cleaned +// with consistent snapping should tile without crossing, but where rounding +// turned a narrow polygon between two others inside out, the area it covered +// may be covered by both of its neighbors. Remove each such overlapping area +// from all but the first of the polygons that cover it. Returns how many +// polygons were changed. +// `hot` is the hot pixels of the layer, from layer_hot_pixels(), if any. +size_t remove_overlaps(std::vector const &geoms, hot_pixel_list const *hot); + #endif diff --git a/tests/ne_110m_admin_0_countries/out/-z1_-yname_--no-simplification-of-shared-nodes.json b/tests/ne_110m_admin_0_countries/out/-z1_-yname_--no-simplification-of-shared-nodes.json index 0d3f30c9..6af13871 100644 --- a/tests/ne_110m_admin_0_countries/out/-z1_-yname_--no-simplification-of-shared-nodes.json +++ b/tests/ne_110m_admin_0_countries/out/-z1_-yname_--no-simplification-of-shared-nodes.json @@ -55,7 +55,7 @@ , { "type": "Feature", "properties": { "name": "Guyana" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -59.765625, 8.407168 ], [ -59.062500, 7.972198 ], [ -58.447266, 7.362467 ], [ -58.447266, 6.839170 ], [ -58.095703, 6.839170 ], [ -57.128906, 5.965754 ], [ -57.304688, 5.090944 ], [ -57.919922, 4.828260 ], [ -57.832031, 4.565474 ], [ -58.007812, 4.039618 ], [ -57.568359, 3.337954 ], [ -57.304688, 3.337954 ], [ -57.128906, 2.811371 ], [ -56.513672, 1.933227 ], [ -57.304688, 1.933227 ], [ -57.656250, 1.669686 ], [ -58.447266, 1.493971 ], [ -58.535156, 1.230374 ], [ -59.062500, 1.318243 ], [ -59.677734, 1.757537 ], [ -59.941406, 2.723583 ], [ -59.853516, 3.601142 ], [ -59.501953, 3.951941 ], [ -59.765625, 4.390229 ], [ -60.117188, 4.565474 ], [ -59.941406, 5.003394 ], [ -60.205078, 5.266008 ], [ -60.732422, 5.178482 ], [ -61.435547, 5.965754 ], [ -61.171875, 6.227934 ], [ -61.171875, 6.664608 ], [ -60.292969, 7.013668 ], [ -60.644531, 7.449624 ], [ -60.556641, 7.798079 ], [ -59.765625, 8.407168 ] ] ] } } , -{ "type": "Feature", "properties": { "name": "Suriname" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -55.019531, 6.053161 ], [ -53.964844, 5.790897 ], [ -54.492188, 4.915833 ], [ -54.404297, 4.214943 ], [ -53.964844, 3.601142 ], [ -54.492188, 2.284551 ], [ -55.107422, 2.547988 ], [ -55.546875, 2.460181 ], [ -55.986328, 2.547988 ], [ -56.074219, 2.196727 ], [ -55.898438, 2.021065 ], [ -55.986328, 1.845384 ], [ -56.513672, 1.933227 ], [ -57.128906, 2.811371 ], [ -57.304688, 3.337954 ], [ -57.568359, 3.337954 ], [ -58.007812, 4.039618 ], [ -57.832031, 4.565474 ], [ -57.919922, 4.828260 ], [ -57.304688, 5.090944 ], [ -57.128906, 5.965754 ], [ -55.986328, 5.790897 ], [ -55.810547, 5.965754 ], [ -55.019531, 6.053161 ] ] ] } } +{ "type": "Feature", "properties": { "name": "Suriname" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -55.019531, 6.053161 ], [ -53.964844, 5.790897 ], [ -54.492188, 4.915833 ], [ -54.404297, 4.214943 ], [ -54.052734, 3.601142 ], [ -54.492188, 2.284551 ], [ -55.107422, 2.547988 ], [ -55.546875, 2.460181 ], [ -55.986328, 2.547988 ], [ -56.074219, 2.196727 ], [ -55.898438, 2.021065 ], [ -55.986328, 1.845384 ], [ -56.513672, 1.933227 ], [ -57.128906, 2.811371 ], [ -57.304688, 3.337954 ], [ -57.568359, 3.337954 ], [ -58.007812, 4.039618 ], [ -57.832031, 4.565474 ], [ -57.919922, 4.828260 ], [ -57.304688, 5.090944 ], [ -57.128906, 5.965754 ], [ -55.986328, 5.790897 ], [ -55.810547, 5.965754 ], [ -55.019531, 6.053161 ] ] ] } } , { "type": "Feature", "properties": { "name": "Brazil" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -60.205078, 5.266008 ], [ -59.941406, 5.003394 ], [ -60.117188, 4.565474 ], [ -59.765625, 4.390229 ], [ -59.501953, 3.951941 ], [ -59.853516, 3.601142 ], [ -59.941406, 2.723583 ], [ -59.677734, 1.757537 ], [ -59.062500, 1.318243 ], [ -58.535156, 1.230374 ], [ -58.447266, 1.493971 ], [ -57.656250, 1.669686 ], [ -57.304688, 1.933227 ], [ -56.513672, 1.933227 ], [ -55.986328, 1.845384 ], [ -55.898438, 2.021065 ], [ -56.074219, 2.196727 ], [ -55.986328, 2.547988 ], [ -55.546875, 2.460181 ], [ -55.107422, 2.547988 ], [ -54.492188, 2.284551 ], [ -54.052734, 2.108899 ], [ -53.789062, 2.372369 ], [ -53.525391, 2.372369 ], [ -53.437500, 2.021065 ], [ -52.910156, 2.108899 ], [ -52.558594, 2.547988 ], [ -51.679688, 4.127285 ], [ -51.328125, 4.214943 ], [ -50.537109, 1.933227 ], [ -50.009766, 1.757537 ], [ -49.921875, 1.054628 ], [ -50.712891, 0.263671 ], [ -50.361328, -0.087891 ], [ -48.603516, -0.263671 ], [ -48.603516, -1.230374 ], [ -47.812500, -0.615223 ], [ -44.912109, -1.581830 ], [ -44.384766, -2.108899 ], [ -44.560547, -2.723583 ], [ -43.417969, -2.372369 ], [ -41.484375, -2.899153 ], [ -39.990234, -2.899153 ], [ -38.496094, -3.688855 ], [ -37.265625, -4.828260 ], [ -36.474609, -5.090944 ], [ -35.595703, -5.178482 ], [ -35.244141, -5.441022 ], [ -34.716797, -7.362467 ], [ -35.156250, -9.015302 ], [ -37.089844, -11.005904 ], [ -37.705078, -12.211180 ], [ -38.408203, -13.068777 ], [ -38.671875, -13.068777 ], [ -38.935547, -13.752725 ], [ -38.847656, -15.707663 ], [ -39.287109, -17.895114 ], [ -39.550781, -18.229351 ], [ -39.726562, -19.559790 ], [ -40.781250, -20.879343 ], [ -40.957031, -21.943046 ], [ -41.748047, -22.350076 ], [ -42.011719, -22.998852 ], [ -43.066406, -22.998852 ], [ -44.648438, -23.322080 ], [ -45.351562, -23.805450 ], [ -46.494141, -24.126702 ], [ -47.636719, -24.846565 ], [ -48.515625, -25.878994 ], [ -48.603516, -26.588527 ], [ -48.515625, -27.137368 ], [ -48.691406, -28.149503 ], [ -48.867188, -28.690588 ], [ -49.570312, -29.228890 ], [ -50.712891, -30.977609 ], [ -52.294922, -32.249974 ], [ -52.734375, -33.211116 ], [ -53.349609, -33.797409 ], [ -53.613281, -33.211116 ], [ -53.173828, -32.694866 ], [ -53.789062, -32.026706 ], [ -55.634766, -30.826781 ], [ -55.986328, -30.902225 ], [ -56.953125, -30.145127 ], [ -57.656250, -30.221102 ], [ -55.195312, -27.916767 ], [ -53.613281, -26.902477 ], [ -53.613281, -26.115986 ], [ -54.140625, -25.562265 ], [ -54.667969, -25.720735 ], [ -54.316406, -24.607069 ], [ -54.316406, -24.046464 ], [ -54.667969, -23.805450 ], [ -55.019531, -23.966176 ], [ -55.371094, -23.966176 ], [ -55.634766, -22.674847 ], [ -55.810547, -22.350076 ], [ -56.513672, -22.105999 ], [ -56.865234, -22.268764 ], [ -57.919922, -22.105999 ], [ -57.832031, -20.715015 ], [ -58.183594, -20.138470 ], [ -57.832031, -19.973349 ], [ -57.919922, -19.394068 ], [ -57.656250, -18.979026 ], [ -57.480469, -18.145852 ], [ -57.744141, -17.560247 ], [ -58.271484, -17.308688 ], [ -58.359375, -16.888660 ], [ -58.271484, -16.299051 ], [ -60.117188, -16.299051 ], [ -60.556641, -15.114553 ], [ -60.292969, -15.114553 ], [ -60.468750, -13.752725 ], [ -61.083984, -13.496473 ], [ -61.699219, -13.496473 ], [ -62.138672, -13.239945 ], [ -62.841797, -12.983148 ], [ -63.193359, -12.640338 ], [ -64.335938, -12.468760 ], [ -65.390625, -11.609193 ], [ -65.302734, -9.795678 ], [ -66.621094, -9.968851 ], [ -68.027344, -10.746969 ], [ -68.291016, -11.005904 ], [ -69.521484, -10.919618 ], [ -70.136719, -11.092166 ], [ -70.576172, -11.005904 ], [ -70.488281, -9.449062 ], [ -71.279297, -10.055403 ], [ -72.158203, -10.055403 ], [ -72.597656, -9.535749 ], [ -73.212891, -9.449062 ], [ -73.037109, -9.015302 ], [ -73.564453, -8.407168 ], [ -74.003906, -7.536764 ], [ -73.740234, -7.362467 ], [ -73.740234, -6.926427 ], [ -73.125000, -6.664608 ], [ -73.212891, -6.053161 ], [ -72.949219, -5.703448 ], [ -72.861328, -5.266008 ], [ -71.718750, -4.565474 ], [ -70.927734, -4.390229 ], [ -70.751953, -4.214943 ], [ -69.873047, -4.302591 ], [ -69.433594, -1.142502 ], [ -69.609375, -0.527336 ], [ -70.048828, -0.175781 ], [ -70.048828, 0.527336 ], [ -69.433594, 0.703107 ], [ -69.257812, 0.615223 ], [ -69.257812, 0.966751 ], [ -69.785156, 1.054628 ], [ -69.785156, 1.757537 ], [ -67.851562, 1.669686 ], [ -67.500000, 2.021065 ], [ -67.236328, 1.757537 ], [ -67.060547, 1.142502 ], [ -66.884766, 1.230374 ], [ -66.357422, 0.703107 ], [ -65.566406, 0.790990 ], [ -65.390625, 1.054628 ], [ -64.160156, 1.493971 ], [ -64.072266, 1.933227 ], [ -63.369141, 2.196727 ], [ -63.457031, 2.372369 ], [ -64.248047, 2.460181 ], [ -64.423828, 3.162456 ], [ -64.335938, 3.776559 ], [ -64.775391, 4.039618 ], [ -64.599609, 4.127285 ], [ -63.105469, 3.776559 ], [ -62.841797, 4.039618 ], [ -60.996094, 4.565474 ], [ -60.644531, 4.915833 ], [ -60.732422, 5.178482 ], [ -60.205078, 5.266008 ] ] ] } } , @@ -735,7 +735,7 @@ , { "type": "Feature", "properties": { "name": "Djibouti" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 43.066406, 12.683215 ], [ 43.330078, 12.382928 ], [ 43.286133, 11.996338 ], [ 42.714844, 11.738302 ], [ 43.154297, 11.480025 ], [ 42.758789, 10.919618 ], [ 42.539062, 11.092166 ], [ 42.319336, 11.049038 ], [ 41.748047, 11.049038 ], [ 41.660156, 11.652236 ], [ 42.363281, 12.554564 ], [ 42.758789, 12.468760 ], [ 43.066406, 12.683215 ] ] ] } } , -{ "type": "Feature", "properties": { "name": "Russia" }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 104.370117, 77.702234 ], [ 106.083984, 77.370301 ], [ 104.721680, 77.127825 ], [ 106.962891, 76.970245 ], [ 107.226562, 76.475773 ], [ 108.149414, 76.720223 ], [ 111.093750, 76.710125 ], [ 113.334961, 76.226907 ], [ 114.125977, 75.845169 ], [ 113.906250, 75.331158 ], [ 112.763672, 75.027664 ], [ 110.170898, 74.472903 ], [ 109.379883, 74.176073 ], [ 110.654297, 74.043723 ], [ 112.104492, 73.788054 ], [ 113.027344, 73.971078 ], [ 113.510742, 73.340461 ], [ 113.950195, 73.590586 ], [ 115.576172, 73.751205 ], [ 118.784180, 73.590586 ], [ 119.003906, 73.124945 ], [ 123.178711, 72.971189 ], [ 123.266602, 73.738905 ], [ 125.375977, 73.565739 ], [ 126.958008, 73.565739 ], [ 128.583984, 73.035419 ], [ 129.067383, 72.395706 ], [ 128.452148, 71.978988 ], [ 129.726562, 71.187754 ], [ 131.308594, 70.786910 ], [ 132.275391, 71.842539 ], [ 133.857422, 71.385142 ], [ 135.571289, 71.649833 ], [ 137.504883, 71.343013 ], [ 138.251953, 71.622143 ], [ 139.877930, 71.483086 ], [ 139.130859, 72.422268 ], [ 140.449219, 72.854981 ], [ 149.501953, 72.195246 ], [ 150.336914, 71.608283 ], [ 152.973633, 70.844673 ], [ 157.016602, 71.031249 ], [ 158.994141, 70.873491 ], [ 159.829102, 70.451508 ], [ 159.697266, 69.718107 ], [ 160.927734, 69.442128 ], [ 162.290039, 69.641804 ], [ 164.047852, 69.672358 ], [ 165.937500, 69.472969 ], [ 167.827148, 69.580563 ], [ 169.584961, 68.688521 ], [ 170.815430, 69.021414 ], [ 170.024414, 69.657086 ], [ 170.463867, 70.095529 ], [ 173.627930, 69.824471 ], [ 175.737305, 69.869892 ], [ 178.593750, 69.395783 ], [ 180.000000, 68.958391 ], [ 180.043945, 68.958391 ], [ 180.043945, 68.942607 ], [ 182.460938, 68.204212 ], [ 183.515625, 67.809245 ], [ 183.515625, 65.403445 ], [ 182.768555, 65.512963 ], [ 181.625977, 65.385147 ], [ 181.098633, 65.748683 ], [ 181.318359, 66.107170 ], [ 180.131836, 65.874725 ], [ 180.571289, 65.403445 ], [ 180.043945, 65.016506 ], [ 180.043945, 64.979359 ], [ 180.000000, 64.979359 ], [ 178.725586, 64.529548 ], [ 177.407227, 64.605038 ], [ 178.330078, 64.072200 ], [ 178.901367, 63.253412 ], [ 179.384766, 62.975198 ], [ 179.472656, 62.573106 ], [ 179.208984, 62.308794 ], [ 177.363281, 62.512318 ], [ 174.550781, 61.773123 ], [ 173.671875, 61.648162 ], [ 172.133789, 60.951777 ], [ 170.683594, 60.326948 ], [ 170.332031, 59.888937 ], [ 168.881836, 60.565379 ], [ 166.289062, 59.778522 ], [ 165.849609, 60.152442 ], [ 164.882812, 59.734253 ], [ 163.520508, 59.866883 ], [ 163.212891, 59.220934 ], [ 162.026367, 58.240164 ], [ 162.070312, 57.844751 ], [ 163.212891, 57.610107 ], [ 163.037109, 56.170023 ], [ 162.114258, 56.121060 ], [ 161.718750, 55.279115 ], [ 162.114258, 54.851315 ], [ 160.356445, 54.342149 ], [ 160.004883, 53.199452 ], [ 158.510742, 52.961875 ], [ 158.247070, 51.944265 ], [ 156.796875, 51.013755 ], [ 156.401367, 51.699800 ], [ 156.005859, 53.146770 ], [ 155.434570, 55.379110 ], [ 155.917969, 56.776808 ], [ 156.752930, 57.373938 ], [ 156.796875, 57.821355 ], [ 158.378906, 58.054632 ], [ 160.136719, 59.310768 ], [ 161.850586, 60.348696 ], [ 163.652344, 61.143235 ], [ 164.487305, 62.552857 ], [ 163.256836, 62.471724 ], [ 162.641602, 61.648162 ], [ 160.136719, 60.543775 ], [ 159.301758, 61.773123 ], [ 156.708984, 61.438767 ], [ 154.204102, 59.756395 ], [ 155.039062, 59.153403 ], [ 152.797852, 58.881942 ], [ 151.259766, 58.790978 ], [ 151.347656, 59.512029 ], [ 149.765625, 59.645540 ], [ 148.535156, 59.153403 ], [ 145.502930, 59.333189 ], [ 142.207031, 59.040555 ], [ 138.955078, 57.088515 ], [ 135.131836, 54.724620 ], [ 136.713867, 54.597528 ], [ 137.197266, 53.981935 ], [ 138.164062, 53.748711 ], [ 138.823242, 54.265224 ], [ 139.921875, 54.188155 ], [ 141.328125, 53.094024 ], [ 141.372070, 52.241256 ], [ 140.581055, 51.234407 ], [ 140.493164, 50.035974 ], [ 140.053711, 48.458352 ], [ 138.559570, 47.010226 ], [ 138.208008, 46.316584 ], [ 134.868164, 43.389082 ], [ 133.549805, 42.811522 ], [ 132.890625, 42.811522 ], [ 132.275391, 43.293200 ], [ 130.957031, 42.553080 ], [ 130.781250, 42.228517 ], [ 130.649414, 42.391009 ], [ 130.649414, 42.908160 ], [ 131.132812, 42.940339 ], [ 131.308594, 44.119142 ], [ 131.044922, 44.964798 ], [ 131.879883, 45.305803 ], [ 133.110352, 45.151053 ], [ 133.769531, 46.103709 ], [ 134.121094, 47.219568 ], [ 134.516602, 47.576526 ], [ 135.043945, 48.487486 ], [ 133.374023, 48.195387 ], [ 132.495117, 47.783635 ], [ 131.000977, 47.783635 ], [ 130.561523, 48.719961 ], [ 129.418945, 49.439557 ], [ 127.661133, 49.752880 ], [ 127.265625, 50.736455 ], [ 126.958008, 51.344339 ], [ 126.562500, 51.781436 ], [ 125.947266, 52.802761 ], [ 125.068359, 53.173119 ], [ 123.574219, 53.461890 ], [ 122.255859, 53.435719 ], [ 120.981445, 53.252069 ], [ 120.190430, 52.749594 ], [ 120.717773, 52.509535 ], [ 120.717773, 51.971346 ], [ 120.190430, 51.645294 ], [ 119.267578, 50.569283 ], [ 119.267578, 50.148746 ], [ 117.861328, 49.525208 ], [ 116.674805, 49.894634 ], [ 115.488281, 49.809632 ], [ 114.960938, 50.148746 ], [ 114.345703, 50.261254 ], [ 112.895508, 49.553726 ], [ 111.577148, 49.382373 ], [ 110.654297, 49.124219 ], [ 109.423828, 49.296472 ], [ 108.457031, 49.296472 ], [ 107.885742, 49.781264 ], [ 106.875000, 50.261254 ], [ 105.908203, 50.401515 ], [ 104.633789, 50.289339 ], [ 103.666992, 50.092393 ], [ 102.260742, 50.513427 ], [ 102.084961, 51.261915 ], [ 100.898438, 51.508742 ], [ 99.975586, 51.645294 ], [ 98.876953, 52.052490 ], [ 97.822266, 51.013755 ], [ 98.217773, 50.429518 ], [ 97.250977, 49.724479 ], [ 95.800781, 49.979488 ], [ 94.833984, 50.007739 ], [ 94.130859, 50.485474 ], [ 93.120117, 50.485474 ], [ 92.241211, 50.792047 ], [ 90.703125, 50.345460 ], [ 88.813477, 49.468124 ], [ 87.758789, 49.296472 ], [ 87.363281, 49.210420 ], [ 86.835938, 49.837982 ], [ 85.561523, 49.696062 ], [ 85.122070, 50.120578 ], [ 84.418945, 50.317408 ], [ 83.935547, 50.903033 ], [ 83.364258, 51.069017 ], [ 81.958008, 50.819818 ], [ 80.551758, 51.399206 ], [ 80.024414, 50.875311 ], [ 77.783203, 53.409532 ], [ 76.508789, 54.188155 ], [ 76.904297, 54.495568 ], [ 74.399414, 53.540307 ], [ 73.432617, 53.488046 ], [ 73.520508, 54.033586 ], [ 72.246094, 54.367759 ], [ 71.191406, 54.136696 ], [ 70.883789, 55.178868 ], [ 69.082031, 55.379110 ], [ 68.159180, 54.977614 ], [ 65.654297, 54.597528 ], [ 65.170898, 54.342149 ], [ 61.435547, 54.007769 ], [ 60.996094, 53.670680 ], [ 61.699219, 52.988337 ], [ 60.732422, 52.722986 ], [ 60.908203, 52.456009 ], [ 59.985352, 51.971346 ], [ 61.567383, 51.261915 ], [ 61.347656, 50.792047 ], [ 59.941406, 50.847573 ], [ 59.633789, 50.541363 ], [ 58.359375, 51.069017 ], [ 56.777344, 51.041394 ], [ 55.722656, 50.625073 ], [ 54.536133, 51.013755 ], [ 52.338867, 51.727028 ], [ 50.756836, 51.699800 ], [ 48.691406, 50.597186 ], [ 48.559570, 49.866317 ], [ 47.548828, 50.457504 ], [ 46.757812, 49.353756 ], [ 47.065430, 49.152970 ], [ 46.450195, 48.400032 ], [ 47.329102, 47.724545 ], [ 48.076172, 47.754098 ], [ 48.691406, 47.070122 ], [ 48.603516, 46.558860 ], [ 49.086914, 46.407564 ], [ 48.647461, 45.798170 ], [ 47.680664, 45.644768 ], [ 46.669922, 44.621754 ], [ 47.592773, 43.675818 ], [ 47.504883, 42.972502 ], [ 48.603516, 41.804078 ], [ 47.988281, 41.409776 ], [ 47.812500, 41.145570 ], [ 47.373047, 41.211722 ], [ 46.669922, 41.836828 ], [ 46.406250, 41.869561 ], [ 45.791016, 42.098222 ], [ 45.483398, 42.488302 ], [ 44.516602, 42.714732 ], [ 43.945312, 42.553080 ], [ 43.769531, 42.747012 ], [ 42.407227, 43.229195 ], [ 40.913086, 43.389082 ], [ 40.078125, 43.548548 ], [ 39.946289, 43.421009 ], [ 38.671875, 44.276671 ], [ 37.529297, 44.653024 ], [ 36.694336, 45.243953 ], [ 37.397461, 45.398450 ], [ 38.232422, 46.255847 ], [ 37.661133, 46.649436 ], [ 39.155273, 47.040182 ], [ 39.111328, 47.249407 ], [ 38.232422, 47.100045 ], [ 38.276367, 47.546872 ], [ 38.759766, 47.813155 ], [ 39.726562, 47.901614 ], [ 39.902344, 48.224673 ], [ 39.682617, 48.777913 ], [ 40.078125, 49.296472 ], [ 40.078125, 49.610710 ], [ 38.583984, 49.922935 ], [ 38.012695, 49.922935 ], [ 37.397461, 50.373496 ], [ 36.606445, 50.233152 ], [ 35.375977, 50.569283 ], [ 35.375977, 50.764259 ], [ 35.024414, 51.206883 ], [ 34.233398, 51.261915 ], [ 34.145508, 51.563412 ], [ 34.409180, 51.781436 ], [ 33.750000, 52.321911 ], [ 32.695312, 52.241256 ], [ 32.431641, 52.295042 ], [ 32.167969, 52.052490 ], [ 31.772461, 52.106505 ], [ 31.552734, 52.749594 ], [ 31.289062, 53.067627 ], [ 31.508789, 53.173119 ], [ 32.299805, 53.120405 ], [ 32.695312, 53.357109 ], [ 32.387695, 53.618579 ], [ 31.728516, 53.800651 ], [ 31.772461, 53.981935 ], [ 31.376953, 54.162434 ], [ 30.761719, 54.800685 ], [ 30.981445, 55.078367 ], [ 30.893555, 55.553495 ], [ 29.882812, 55.801281 ], [ 29.355469, 55.677584 ], [ 29.223633, 55.924586 ], [ 28.168945, 56.170023 ], [ 27.861328, 56.752723 ], [ 27.773438, 57.255281 ], [ 27.290039, 57.468589 ], [ 27.729492, 57.797944 ], [ 27.421875, 58.722599 ], [ 28.125000, 59.310768 ], [ 27.993164, 59.467408 ], [ 29.135742, 60.020952 ], [ 28.081055, 60.500525 ], [ 30.190430, 61.773123 ], [ 31.157227, 62.349609 ], [ 31.508789, 62.875188 ], [ 30.014648, 63.548552 ], [ 30.454102, 64.206377 ], [ 29.531250, 64.942160 ], [ 30.234375, 65.802776 ], [ 29.047852, 66.947274 ], [ 29.970703, 67.692771 ], [ 28.432617, 68.366801 ], [ 28.608398, 69.068563 ], [ 29.399414, 69.162558 ], [ 31.113281, 69.565226 ], [ 32.124023, 69.900118 ], [ 33.793945, 69.302794 ], [ 36.518555, 69.068563 ], [ 40.297852, 67.925140 ], [ 41.044922, 67.458082 ], [ 41.132812, 66.791909 ], [ 40.034180, 66.266856 ], [ 38.364258, 66.000150 ], [ 33.925781, 66.757250 ], [ 33.178711, 66.635556 ], [ 34.804688, 65.892680 ], [ 34.936523, 64.415921 ], [ 36.210938, 64.110602 ], [ 37.001953, 63.840668 ], [ 37.133789, 64.339908 ], [ 36.518555, 64.755390 ], [ 37.177734, 65.146115 ], [ 39.594727, 64.529548 ], [ 40.429688, 64.755390 ], [ 39.770508, 65.494741 ], [ 42.099609, 66.478208 ], [ 43.022461, 66.425537 ], [ 43.945312, 66.071546 ], [ 44.516602, 66.757250 ], [ 43.681641, 67.356785 ], [ 44.208984, 67.958148 ], [ 43.461914, 68.576441 ], [ 46.230469, 68.253111 ], [ 46.801758, 67.692771 ], [ 45.571289, 67.558948 ], [ 45.571289, 67.016009 ], [ 46.362305, 66.670387 ], [ 47.900391, 66.878345 ], [ 48.120117, 67.525373 ], [ 50.229492, 67.991108 ], [ 53.701172, 68.863517 ], [ 54.492188, 68.815927 ], [ 53.481445, 68.204212 ], [ 54.711914, 68.089709 ], [ 55.458984, 68.431513 ], [ 57.304688, 68.463800 ], [ 58.798828, 68.879358 ], [ 59.941406, 68.285651 ], [ 61.083984, 68.942607 ], [ 60.029297, 69.519147 ], [ 60.556641, 69.854762 ], [ 63.500977, 69.549877 ], [ 64.907227, 69.240579 ], [ 68.510742, 68.089709 ], [ 69.169922, 68.608521 ], [ 68.159180, 69.146920 ], [ 68.115234, 69.349339 ], [ 66.928711, 69.457554 ], [ 67.280273, 69.930300 ], [ 66.708984, 70.714471 ], [ 66.708984, 71.031249 ], [ 68.554688, 71.938158 ], [ 69.213867, 72.842021 ], [ 69.960938, 73.035419 ], [ 72.597656, 72.777081 ], [ 72.817383, 72.222101 ], [ 71.850586, 71.413177 ], [ 72.465820, 71.088305 ], [ 72.773438, 70.392606 ], [ 72.553711, 69.021414 ], [ 73.652344, 68.415352 ], [ 73.256836, 67.742759 ], [ 71.279297, 66.319861 ], [ 72.421875, 66.178266 ], [ 72.817383, 66.530768 ], [ 73.916016, 66.791909 ], [ 74.179688, 67.289015 ], [ 75.058594, 67.759398 ], [ 74.487305, 68.334376 ], [ 74.926758, 68.989925 ], [ 73.828125, 69.068563 ], [ 73.608398, 69.626510 ], [ 74.399414, 70.627197 ], [ 73.081055, 71.441171 ], [ 74.882812, 72.114445 ], [ 74.663086, 72.829052 ], [ 75.146484, 72.854981 ], [ 75.673828, 72.302431 ], [ 75.278320, 71.328950 ], [ 76.376953, 71.159391 ], [ 75.893555, 71.869909 ], [ 77.563477, 72.262310 ], [ 79.672852, 72.315785 ], [ 81.518555, 71.746432 ], [ 80.595703, 72.580829 ], [ 80.507812, 73.652545 ], [ 82.265625, 73.849286 ], [ 84.638672, 73.800318 ], [ 86.835938, 73.934634 ], [ 86.000977, 74.461134 ], [ 87.187500, 75.118222 ], [ 88.330078, 75.140778 ], [ 90.263672, 75.639536 ], [ 92.900391, 75.769747 ], [ 93.251953, 76.047916 ], [ 95.844727, 76.142958 ], [ 96.679688, 75.920199 ], [ 98.920898, 76.444907 ], [ 100.766602, 76.434604 ], [ 101.030273, 76.860810 ], [ 101.997070, 77.283532 ], [ 104.370117, 77.702234 ] ] ], [ [ [ 68.159180, 76.940488 ], [ 68.862305, 76.547523 ], [ 68.159180, 76.237366 ], [ 64.643555, 75.737303 ], [ 61.567383, 75.264239 ], [ 58.491211, 74.307353 ], [ 56.997070, 73.327858 ], [ 55.415039, 72.369105 ], [ 55.634766, 71.538830 ], [ 57.524414, 70.714471 ], [ 56.953125, 70.627197 ], [ 53.657227, 70.757966 ], [ 53.393555, 71.201920 ], [ 51.591797, 71.469124 ], [ 51.459961, 72.019729 ], [ 52.470703, 72.235514 ], [ 52.426758, 72.777081 ], [ 54.448242, 73.627789 ], [ 53.525391, 73.751205 ], [ 55.898438, 74.625101 ], [ 55.634766, 75.084326 ], [ 57.875977, 75.606801 ], [ 61.171875, 76.247817 ], [ 64.511719, 76.434604 ], [ 66.225586, 76.810769 ], [ 68.159180, 76.940488 ] ] ], [ [ [ 95.932617, 81.248348 ], [ 97.866211, 80.746492 ], [ 100.195312, 79.781164 ], [ 99.931641, 78.878528 ], [ 97.778320, 78.759229 ], [ 94.965820, 79.046790 ], [ 93.295898, 79.424308 ], [ 92.548828, 80.141163 ], [ 91.186523, 80.342262 ], [ 93.779297, 81.024916 ], [ 95.932617, 81.248348 ] ] ], [ [ [ 138.823242, 76.132430 ], [ 141.459961, 76.090236 ], [ 145.107422, 75.563041 ], [ 144.316406, 74.821934 ], [ 140.625000, 74.844929 ], [ 138.955078, 74.613445 ], [ 136.977539, 75.264239 ], [ 137.504883, 75.952235 ], [ 138.823242, 76.132430 ] ] ], [ [ [ 102.084961, 79.343349 ], [ 102.832031, 79.278140 ], [ 105.380859, 78.716316 ], [ 105.073242, 78.304955 ], [ 99.448242, 77.924866 ], [ 101.250000, 79.237185 ], [ 102.084961, 79.343349 ] ] ], [ [ [ 142.646484, 54.367759 ], [ 143.261719, 52.749594 ], [ 143.217773, 51.754240 ], [ 143.657227, 50.736455 ], [ 144.667969, 48.980217 ], [ 143.173828, 49.296472 ], [ 142.558594, 47.872144 ], [ 143.525391, 46.830134 ], [ 143.525391, 46.134170 ], [ 142.734375, 46.739861 ], [ 142.075195, 45.981695 ], [ 141.899414, 46.800059 ], [ 142.031250, 47.783635 ], [ 141.899414, 48.864715 ], [ 142.119141, 49.610710 ], [ 142.163086, 50.958427 ], [ 141.591797, 51.944265 ], [ 141.679688, 53.304621 ], [ 142.602539, 53.774689 ], [ 142.207031, 54.213861 ], [ 142.646484, 54.367759 ] ] ], [ [ [ 50.053711, 80.921494 ], [ 51.503906, 80.696895 ], [ 51.152344, 80.546518 ], [ 48.911133, 80.342262 ], [ 48.735352, 80.178713 ], [ 47.592773, 80.012423 ], [ 46.494141, 80.245949 ], [ 47.065430, 80.560943 ], [ 44.868164, 80.589727 ], [ 46.801758, 80.774716 ], [ 48.339844, 80.781758 ], [ 48.515625, 80.517603 ], [ 49.086914, 80.753556 ], [ 50.053711, 80.921494 ] ] ], [ [ [ 146.337891, 75.497157 ], [ 148.227539, 75.342282 ], [ 150.732422, 75.084326 ], [ 149.589844, 74.683250 ], [ 147.963867, 74.775843 ], [ 146.118164, 75.174549 ], [ 146.337891, 75.497157 ] ] ], [ [ [ 180.966797, 71.552741 ], [ 182.416992, 71.272595 ], [ 182.329102, 71.130988 ], [ 181.318359, 70.887885 ], [ 180.043945, 70.830248 ], [ 180.000000, 70.830248 ], [ 178.901367, 70.786910 ], [ 178.725586, 71.102543 ], [ 179.956055, 71.497037 ], [ 179.956055, 71.510978 ], [ 180.000000, 71.510978 ], [ 180.131836, 71.552741 ], [ 180.966797, 71.552741 ] ] ], [ [ [ 142.075195, 73.861506 ], [ 143.481445, 73.478485 ], [ 143.613281, 73.214013 ], [ 142.075195, 73.201317 ], [ 140.053711, 73.315246 ], [ 139.877930, 73.365639 ], [ 140.800781, 73.763497 ], [ 142.075195, 73.861506 ] ] ], [ [ [ 21.269531, 55.178868 ], [ 22.324219, 55.002826 ], [ 22.763672, 54.851315 ], [ 22.631836, 54.572062 ], [ 22.719727, 54.316523 ], [ 20.874023, 54.316523 ], [ 19.643555, 54.418930 ], [ 19.907227, 54.876607 ], [ 21.269531, 55.178868 ] ] ] ] } } +{ "type": "Feature", "properties": { "name": "Russia" }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 104.370117, 77.702234 ], [ 106.083984, 77.370301 ], [ 104.721680, 77.127825 ], [ 106.962891, 76.970245 ], [ 107.226562, 76.475773 ], [ 108.149414, 76.720223 ], [ 111.093750, 76.710125 ], [ 113.334961, 76.226907 ], [ 114.125977, 75.845169 ], [ 113.906250, 75.331158 ], [ 112.763672, 75.027664 ], [ 110.170898, 74.472903 ], [ 109.379883, 74.176073 ], [ 110.654297, 74.043723 ], [ 112.104492, 73.788054 ], [ 113.027344, 73.971078 ], [ 113.510742, 73.340461 ], [ 113.950195, 73.590586 ], [ 115.576172, 73.751205 ], [ 118.784180, 73.590586 ], [ 119.003906, 73.124945 ], [ 123.178711, 72.971189 ], [ 123.266602, 73.738905 ], [ 125.375977, 73.565739 ], [ 126.958008, 73.565739 ], [ 128.583984, 73.035419 ], [ 129.067383, 72.395706 ], [ 128.452148, 71.978988 ], [ 129.726562, 71.187754 ], [ 131.308594, 70.786910 ], [ 132.275391, 71.842539 ], [ 133.857422, 71.385142 ], [ 135.571289, 71.649833 ], [ 137.504883, 71.343013 ], [ 138.251953, 71.622143 ], [ 139.877930, 71.483086 ], [ 139.130859, 72.422268 ], [ 140.449219, 72.854981 ], [ 149.501953, 72.195246 ], [ 150.336914, 71.608283 ], [ 152.973633, 70.844673 ], [ 157.016602, 71.031249 ], [ 158.994141, 70.873491 ], [ 159.829102, 70.451508 ], [ 159.697266, 69.718107 ], [ 160.927734, 69.442128 ], [ 162.290039, 69.641804 ], [ 164.047852, 69.672358 ], [ 165.937500, 69.472969 ], [ 167.827148, 69.580563 ], [ 169.584961, 68.688521 ], [ 170.815430, 69.021414 ], [ 170.024414, 69.657086 ], [ 170.463867, 70.095529 ], [ 173.627930, 69.824471 ], [ 175.737305, 69.869892 ], [ 178.593750, 69.395783 ], [ 180.000000, 68.958391 ], [ 180.043945, 68.958391 ], [ 180.043945, 68.942607 ], [ 182.460938, 68.204212 ], [ 183.515625, 67.809245 ], [ 183.515625, 65.403445 ], [ 182.768555, 65.512963 ], [ 181.625977, 65.385147 ], [ 181.098633, 65.748683 ], [ 181.318359, 66.107170 ], [ 180.131836, 65.874725 ], [ 180.571289, 65.403445 ], [ 180.043945, 65.016506 ], [ 180.043945, 64.979359 ], [ 180.000000, 64.979359 ], [ 178.725586, 64.529548 ], [ 177.407227, 64.605038 ], [ 178.330078, 64.072200 ], [ 178.901367, 63.253412 ], [ 179.384766, 62.975198 ], [ 179.472656, 62.573106 ], [ 179.208984, 62.308794 ], [ 177.363281, 62.512318 ], [ 174.550781, 61.773123 ], [ 173.671875, 61.648162 ], [ 172.133789, 60.951777 ], [ 170.683594, 60.326948 ], [ 170.332031, 59.888937 ], [ 168.881836, 60.565379 ], [ 166.289062, 59.778522 ], [ 165.849609, 60.152442 ], [ 164.882812, 59.734253 ], [ 163.520508, 59.866883 ], [ 163.212891, 59.220934 ], [ 162.026367, 58.240164 ], [ 162.070312, 57.844751 ], [ 163.212891, 57.610107 ], [ 163.037109, 56.170023 ], [ 162.114258, 56.121060 ], [ 161.718750, 55.279115 ], [ 162.114258, 54.851315 ], [ 160.356445, 54.342149 ], [ 160.004883, 53.199452 ], [ 158.510742, 52.961875 ], [ 158.247070, 51.944265 ], [ 156.796875, 51.013755 ], [ 156.401367, 51.699800 ], [ 156.005859, 53.146770 ], [ 155.434570, 55.379110 ], [ 155.917969, 56.776808 ], [ 156.752930, 57.373938 ], [ 156.796875, 57.821355 ], [ 158.378906, 58.054632 ], [ 160.136719, 59.310768 ], [ 161.850586, 60.348696 ], [ 163.652344, 61.143235 ], [ 164.487305, 62.552857 ], [ 163.256836, 62.471724 ], [ 162.641602, 61.648162 ], [ 160.136719, 60.543775 ], [ 159.301758, 61.773123 ], [ 156.708984, 61.438767 ], [ 154.204102, 59.756395 ], [ 155.039062, 59.153403 ], [ 152.797852, 58.881942 ], [ 151.259766, 58.790978 ], [ 151.347656, 59.512029 ], [ 149.765625, 59.645540 ], [ 148.535156, 59.153403 ], [ 145.502930, 59.333189 ], [ 142.207031, 59.040555 ], [ 138.955078, 57.088515 ], [ 135.131836, 54.724620 ], [ 136.713867, 54.597528 ], [ 137.197266, 53.981935 ], [ 138.164062, 53.748711 ], [ 138.823242, 54.265224 ], [ 139.921875, 54.188155 ], [ 141.328125, 53.094024 ], [ 141.372070, 52.241256 ], [ 140.581055, 51.234407 ], [ 140.493164, 50.035974 ], [ 140.053711, 48.458352 ], [ 138.559570, 47.010226 ], [ 138.208008, 46.316584 ], [ 134.868164, 43.389082 ], [ 133.549805, 42.811522 ], [ 132.890625, 42.811522 ], [ 132.275391, 43.293200 ], [ 130.957031, 42.553080 ], [ 130.781250, 42.228517 ], [ 130.649414, 42.391009 ], [ 130.649414, 42.908160 ], [ 131.132812, 42.940339 ], [ 131.308594, 44.119142 ], [ 131.044922, 44.964798 ], [ 131.879883, 45.305803 ], [ 133.110352, 45.151053 ], [ 133.769531, 46.103709 ], [ 134.121094, 47.219568 ], [ 134.516602, 47.576526 ], [ 135.043945, 48.487486 ], [ 133.374023, 48.195387 ], [ 132.495117, 47.783635 ], [ 131.000977, 47.783635 ], [ 130.561523, 48.719961 ], [ 129.418945, 49.439557 ], [ 127.661133, 49.752880 ], [ 127.265625, 50.736455 ], [ 126.958008, 51.344339 ], [ 126.562500, 51.781436 ], [ 125.947266, 52.802761 ], [ 125.068359, 53.173119 ], [ 123.574219, 53.461890 ], [ 122.255859, 53.435719 ], [ 120.981445, 53.252069 ], [ 120.190430, 52.749594 ], [ 120.717773, 52.509535 ], [ 120.717773, 51.971346 ], [ 120.190430, 51.645294 ], [ 119.267578, 50.569283 ], [ 119.267578, 50.148746 ], [ 117.861328, 49.525208 ], [ 116.674805, 49.894634 ], [ 115.488281, 49.809632 ], [ 114.960938, 50.148746 ], [ 114.345703, 50.261254 ], [ 112.895508, 49.553726 ], [ 111.577148, 49.382373 ], [ 110.654297, 49.124219 ], [ 109.423828, 49.296472 ], [ 108.457031, 49.296472 ], [ 107.885742, 49.781264 ], [ 106.875000, 50.261254 ], [ 105.908203, 50.401515 ], [ 104.633789, 50.289339 ], [ 103.666992, 50.092393 ], [ 102.260742, 50.513427 ], [ 102.084961, 51.261915 ], [ 100.898438, 51.508742 ], [ 99.975586, 51.645294 ], [ 98.876953, 52.052490 ], [ 97.822266, 51.013755 ], [ 98.217773, 50.429518 ], [ 97.250977, 49.724479 ], [ 95.800781, 49.979488 ], [ 94.833984, 50.007739 ], [ 94.130859, 50.485474 ], [ 93.120117, 50.485474 ], [ 92.241211, 50.792047 ], [ 90.703125, 50.345460 ], [ 88.813477, 49.468124 ], [ 87.758789, 49.296472 ], [ 87.363281, 49.210420 ], [ 86.835938, 49.837982 ], [ 85.561523, 49.696062 ], [ 85.122070, 50.120578 ], [ 84.418945, 50.317408 ], [ 83.935547, 50.903033 ], [ 83.364258, 51.069017 ], [ 81.958008, 50.819818 ], [ 80.551758, 51.399206 ], [ 80.024414, 50.875311 ], [ 77.783203, 53.409532 ], [ 76.508789, 54.188155 ], [ 76.904297, 54.495568 ], [ 76.860352, 54.495568 ], [ 76.816406, 54.470038 ], [ 74.399414, 53.540307 ], [ 73.432617, 53.488046 ], [ 73.520508, 54.033586 ], [ 72.246094, 54.367759 ], [ 71.191406, 54.136696 ], [ 70.883789, 55.178868 ], [ 69.082031, 55.379110 ], [ 68.159180, 54.977614 ], [ 65.654297, 54.597528 ], [ 65.170898, 54.342149 ], [ 61.435547, 54.007769 ], [ 60.996094, 53.670680 ], [ 61.699219, 52.988337 ], [ 60.732422, 52.722986 ], [ 60.908203, 52.456009 ], [ 59.985352, 51.971346 ], [ 61.567383, 51.261915 ], [ 61.347656, 50.792047 ], [ 59.941406, 50.847573 ], [ 59.633789, 50.541363 ], [ 58.359375, 51.069017 ], [ 56.777344, 51.041394 ], [ 55.722656, 50.625073 ], [ 54.536133, 51.013755 ], [ 52.338867, 51.727028 ], [ 50.756836, 51.699800 ], [ 48.691406, 50.597186 ], [ 48.559570, 49.866317 ], [ 47.548828, 50.457504 ], [ 46.757812, 49.353756 ], [ 47.065430, 49.152970 ], [ 46.450195, 48.400032 ], [ 47.329102, 47.724545 ], [ 48.076172, 47.754098 ], [ 48.691406, 47.070122 ], [ 48.603516, 46.558860 ], [ 49.086914, 46.407564 ], [ 48.647461, 45.798170 ], [ 47.680664, 45.644768 ], [ 46.669922, 44.621754 ], [ 47.592773, 43.675818 ], [ 47.504883, 42.972502 ], [ 48.603516, 41.804078 ], [ 47.988281, 41.409776 ], [ 47.812500, 41.145570 ], [ 47.373047, 41.211722 ], [ 46.669922, 41.836828 ], [ 46.406250, 41.869561 ], [ 45.791016, 42.098222 ], [ 45.483398, 42.488302 ], [ 44.516602, 42.714732 ], [ 43.945312, 42.553080 ], [ 43.769531, 42.747012 ], [ 42.407227, 43.229195 ], [ 40.913086, 43.389082 ], [ 40.078125, 43.548548 ], [ 39.946289, 43.421009 ], [ 38.671875, 44.276671 ], [ 37.529297, 44.653024 ], [ 36.694336, 45.243953 ], [ 37.397461, 45.398450 ], [ 38.232422, 46.255847 ], [ 37.661133, 46.649436 ], [ 39.155273, 47.040182 ], [ 39.111328, 47.249407 ], [ 38.232422, 47.100045 ], [ 38.276367, 47.546872 ], [ 38.759766, 47.813155 ], [ 39.726562, 47.901614 ], [ 39.902344, 48.224673 ], [ 39.682617, 48.777913 ], [ 40.078125, 49.296472 ], [ 40.078125, 49.610710 ], [ 38.583984, 49.922935 ], [ 38.012695, 49.922935 ], [ 37.397461, 50.373496 ], [ 36.606445, 50.233152 ], [ 35.375977, 50.569283 ], [ 35.375977, 50.764259 ], [ 35.024414, 51.206883 ], [ 34.233398, 51.261915 ], [ 34.145508, 51.563412 ], [ 34.409180, 51.781436 ], [ 33.750000, 52.321911 ], [ 32.695312, 52.241256 ], [ 32.431641, 52.295042 ], [ 32.167969, 52.052490 ], [ 31.772461, 52.106505 ], [ 31.552734, 52.749594 ], [ 31.289062, 53.067627 ], [ 31.508789, 53.173119 ], [ 32.299805, 53.120405 ], [ 32.695312, 53.357109 ], [ 32.387695, 53.618579 ], [ 31.728516, 53.800651 ], [ 31.772461, 53.981935 ], [ 31.376953, 54.162434 ], [ 30.761719, 54.800685 ], [ 30.981445, 55.078367 ], [ 30.893555, 55.553495 ], [ 29.882812, 55.801281 ], [ 29.355469, 55.677584 ], [ 29.223633, 55.924586 ], [ 28.168945, 56.170023 ], [ 27.861328, 56.752723 ], [ 27.773438, 57.255281 ], [ 27.290039, 57.468589 ], [ 27.729492, 57.797944 ], [ 27.421875, 58.722599 ], [ 28.125000, 59.310768 ], [ 27.993164, 59.467408 ], [ 29.135742, 60.020952 ], [ 28.081055, 60.500525 ], [ 30.190430, 61.773123 ], [ 31.157227, 62.349609 ], [ 31.508789, 62.875188 ], [ 30.014648, 63.548552 ], [ 30.454102, 64.206377 ], [ 29.531250, 64.942160 ], [ 30.234375, 65.802776 ], [ 29.047852, 66.947274 ], [ 29.970703, 67.692771 ], [ 28.432617, 68.366801 ], [ 28.608398, 69.068563 ], [ 29.399414, 69.162558 ], [ 31.113281, 69.565226 ], [ 32.124023, 69.900118 ], [ 33.793945, 69.302794 ], [ 36.518555, 69.068563 ], [ 40.297852, 67.925140 ], [ 41.044922, 67.458082 ], [ 41.132812, 66.791909 ], [ 40.034180, 66.266856 ], [ 38.364258, 66.000150 ], [ 33.925781, 66.757250 ], [ 33.178711, 66.635556 ], [ 34.804688, 65.892680 ], [ 34.936523, 64.415921 ], [ 36.210938, 64.110602 ], [ 37.001953, 63.840668 ], [ 37.133789, 64.339908 ], [ 36.518555, 64.755390 ], [ 37.177734, 65.146115 ], [ 39.594727, 64.529548 ], [ 40.429688, 64.755390 ], [ 39.770508, 65.494741 ], [ 42.099609, 66.478208 ], [ 43.022461, 66.425537 ], [ 43.945312, 66.071546 ], [ 44.516602, 66.757250 ], [ 43.681641, 67.356785 ], [ 44.208984, 67.958148 ], [ 43.461914, 68.576441 ], [ 46.230469, 68.253111 ], [ 46.801758, 67.692771 ], [ 45.571289, 67.558948 ], [ 45.571289, 67.016009 ], [ 46.362305, 66.670387 ], [ 47.900391, 66.878345 ], [ 48.120117, 67.525373 ], [ 50.229492, 67.991108 ], [ 53.701172, 68.863517 ], [ 54.492188, 68.815927 ], [ 53.481445, 68.204212 ], [ 54.711914, 68.089709 ], [ 55.458984, 68.431513 ], [ 57.304688, 68.463800 ], [ 58.798828, 68.879358 ], [ 59.941406, 68.285651 ], [ 61.083984, 68.942607 ], [ 60.029297, 69.519147 ], [ 60.556641, 69.854762 ], [ 63.500977, 69.549877 ], [ 64.907227, 69.240579 ], [ 68.510742, 68.089709 ], [ 69.169922, 68.608521 ], [ 68.159180, 69.146920 ], [ 68.115234, 69.349339 ], [ 66.928711, 69.457554 ], [ 67.280273, 69.930300 ], [ 66.708984, 70.714471 ], [ 66.708984, 71.031249 ], [ 68.554688, 71.938158 ], [ 69.213867, 72.842021 ], [ 69.960938, 73.035419 ], [ 72.597656, 72.777081 ], [ 72.817383, 72.222101 ], [ 71.850586, 71.413177 ], [ 72.465820, 71.088305 ], [ 72.773438, 70.392606 ], [ 72.553711, 69.021414 ], [ 73.652344, 68.415352 ], [ 73.256836, 67.742759 ], [ 71.279297, 66.319861 ], [ 72.421875, 66.178266 ], [ 72.817383, 66.530768 ], [ 73.916016, 66.791909 ], [ 74.179688, 67.289015 ], [ 75.058594, 67.759398 ], [ 74.487305, 68.334376 ], [ 74.926758, 68.989925 ], [ 73.828125, 69.068563 ], [ 73.608398, 69.626510 ], [ 74.399414, 70.627197 ], [ 73.081055, 71.441171 ], [ 74.882812, 72.114445 ], [ 74.663086, 72.829052 ], [ 75.146484, 72.854981 ], [ 75.673828, 72.302431 ], [ 75.278320, 71.328950 ], [ 76.376953, 71.159391 ], [ 75.893555, 71.869909 ], [ 77.563477, 72.262310 ], [ 79.672852, 72.315785 ], [ 81.518555, 71.746432 ], [ 80.595703, 72.580829 ], [ 80.507812, 73.652545 ], [ 82.265625, 73.849286 ], [ 84.638672, 73.800318 ], [ 86.835938, 73.934634 ], [ 86.000977, 74.461134 ], [ 87.187500, 75.118222 ], [ 88.330078, 75.140778 ], [ 90.263672, 75.639536 ], [ 92.900391, 75.769747 ], [ 93.251953, 76.047916 ], [ 95.844727, 76.142958 ], [ 96.679688, 75.920199 ], [ 98.920898, 76.444907 ], [ 100.766602, 76.434604 ], [ 101.030273, 76.860810 ], [ 101.997070, 77.283532 ], [ 104.370117, 77.702234 ] ] ], [ [ [ 68.159180, 76.940488 ], [ 68.862305, 76.547523 ], [ 68.159180, 76.237366 ], [ 64.643555, 75.737303 ], [ 61.567383, 75.264239 ], [ 58.491211, 74.307353 ], [ 56.997070, 73.327858 ], [ 55.415039, 72.369105 ], [ 55.634766, 71.538830 ], [ 57.524414, 70.714471 ], [ 56.953125, 70.627197 ], [ 53.657227, 70.757966 ], [ 53.393555, 71.201920 ], [ 51.591797, 71.469124 ], [ 51.459961, 72.019729 ], [ 52.470703, 72.235514 ], [ 52.426758, 72.777081 ], [ 54.448242, 73.627789 ], [ 53.525391, 73.751205 ], [ 55.898438, 74.625101 ], [ 55.634766, 75.084326 ], [ 57.875977, 75.606801 ], [ 61.171875, 76.247817 ], [ 64.511719, 76.434604 ], [ 66.225586, 76.810769 ], [ 68.159180, 76.940488 ] ] ], [ [ [ 95.932617, 81.248348 ], [ 97.866211, 80.746492 ], [ 100.195312, 79.781164 ], [ 99.931641, 78.878528 ], [ 97.778320, 78.759229 ], [ 94.965820, 79.046790 ], [ 93.295898, 79.424308 ], [ 92.548828, 80.141163 ], [ 91.186523, 80.342262 ], [ 93.779297, 81.024916 ], [ 95.932617, 81.248348 ] ] ], [ [ [ 138.823242, 76.132430 ], [ 141.459961, 76.090236 ], [ 145.107422, 75.563041 ], [ 144.316406, 74.821934 ], [ 140.625000, 74.844929 ], [ 138.955078, 74.613445 ], [ 136.977539, 75.264239 ], [ 137.504883, 75.952235 ], [ 138.823242, 76.132430 ] ] ], [ [ [ 102.084961, 79.343349 ], [ 102.832031, 79.278140 ], [ 105.380859, 78.716316 ], [ 105.073242, 78.304955 ], [ 99.448242, 77.924866 ], [ 101.250000, 79.237185 ], [ 102.084961, 79.343349 ] ] ], [ [ [ 142.646484, 54.367759 ], [ 143.261719, 52.749594 ], [ 143.217773, 51.754240 ], [ 143.657227, 50.736455 ], [ 144.667969, 48.980217 ], [ 143.173828, 49.296472 ], [ 142.558594, 47.872144 ], [ 143.525391, 46.830134 ], [ 143.525391, 46.134170 ], [ 142.734375, 46.739861 ], [ 142.075195, 45.981695 ], [ 141.899414, 46.800059 ], [ 142.031250, 47.783635 ], [ 141.899414, 48.864715 ], [ 142.119141, 49.610710 ], [ 142.163086, 50.958427 ], [ 141.591797, 51.944265 ], [ 141.679688, 53.304621 ], [ 142.602539, 53.774689 ], [ 142.207031, 54.213861 ], [ 142.646484, 54.367759 ] ] ], [ [ [ 50.053711, 80.921494 ], [ 51.503906, 80.696895 ], [ 51.152344, 80.546518 ], [ 48.911133, 80.342262 ], [ 48.735352, 80.178713 ], [ 47.592773, 80.012423 ], [ 46.494141, 80.245949 ], [ 47.065430, 80.560943 ], [ 44.868164, 80.589727 ], [ 46.801758, 80.774716 ], [ 48.339844, 80.781758 ], [ 48.515625, 80.517603 ], [ 49.086914, 80.753556 ], [ 50.053711, 80.921494 ] ] ], [ [ [ 146.337891, 75.497157 ], [ 148.227539, 75.342282 ], [ 150.732422, 75.084326 ], [ 149.589844, 74.683250 ], [ 147.963867, 74.775843 ], [ 146.118164, 75.174549 ], [ 146.337891, 75.497157 ] ] ], [ [ [ 180.966797, 71.552741 ], [ 182.416992, 71.272595 ], [ 182.329102, 71.130988 ], [ 181.318359, 70.887885 ], [ 180.043945, 70.830248 ], [ 180.000000, 70.830248 ], [ 178.901367, 70.786910 ], [ 178.725586, 71.102543 ], [ 179.956055, 71.497037 ], [ 179.956055, 71.510978 ], [ 180.000000, 71.510978 ], [ 180.131836, 71.552741 ], [ 180.966797, 71.552741 ] ] ], [ [ [ 142.075195, 73.861506 ], [ 143.481445, 73.478485 ], [ 143.613281, 73.214013 ], [ 142.075195, 73.201317 ], [ 140.053711, 73.315246 ], [ 139.877930, 73.365639 ], [ 140.800781, 73.763497 ], [ 142.075195, 73.861506 ] ] ], [ [ [ 21.269531, 55.178868 ], [ 22.324219, 55.002826 ], [ 22.763672, 54.851315 ], [ 22.631836, 54.572062 ], [ 22.719727, 54.316523 ], [ 20.874023, 54.316523 ], [ 19.643555, 54.418930 ], [ 19.907227, 54.876607 ], [ 21.269531, 55.178868 ] ] ] ] } } , { "type": "Feature", "properties": { "name": "Kyrgyzstan" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 74.223633, 43.293200 ], [ 75.629883, 42.875964 ], [ 75.981445, 42.972502 ], [ 77.651367, 42.972502 ], [ 79.145508, 42.843751 ], [ 79.628906, 42.488302 ], [ 80.244141, 42.358544 ], [ 80.112305, 42.130821 ], [ 78.530273, 41.574361 ], [ 78.178711, 41.178654 ], [ 76.904297, 41.079351 ], [ 76.508789, 40.413496 ], [ 75.454102, 40.547200 ], [ 74.794922, 40.380028 ], [ 73.828125, 39.909736 ], [ 73.959961, 39.673370 ], [ 73.696289, 39.436193 ], [ 71.806641, 39.266284 ], [ 70.532227, 39.605688 ], [ 69.477539, 39.537940 ], [ 69.565430, 40.111689 ], [ 70.664062, 39.943436 ], [ 71.015625, 40.245992 ], [ 71.762695, 40.145289 ], [ 73.037109, 40.880295 ], [ 71.850586, 41.376809 ], [ 71.147461, 41.145570 ], [ 70.400391, 41.508577 ], [ 71.279297, 42.163403 ], [ 70.971680, 42.261049 ], [ 71.191406, 42.714732 ], [ 71.850586, 42.843751 ], [ 73.476562, 42.488302 ], [ 73.652344, 43.100983 ], [ 74.223633, 43.293200 ] ] ] } } , diff --git a/tests/spindle-shared/out/-z7_-pn.json b/tests/spindle-shared/out/-z7_-pn.json index f67a00dc..47eb6e8f 100644 --- a/tests/spindle-shared/out/-z7_-pn.json +++ b/tests/spindle-shared/out/-z7_-pn.json @@ -21,7 +21,7 @@ , { "type": "Feature", "properties": { "name": "A" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -99.492188, 39.977120 ], [ -100.019531, 39.977120 ], [ -100.019531, 40.044438 ], [ -99.931641, 40.044438 ], [ -99.755859, 40.044438 ], [ -99.492188, 39.977120 ] ] ] } } , -{ "type": "Feature", "properties": { "name": "B" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -99.755859, 40.044438 ], [ -99.492188, 39.977120 ], [ -99.316406, 39.977120 ], [ -99.316406, 39.909736 ], [ -100.019531, 39.909736 ], [ -100.019531, 39.977120 ], [ -99.931641, 40.044438 ], [ -99.755859, 40.044438 ] ] ] } } +{ "type": "Feature", "properties": { "name": "B" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -100.019531, 39.977120 ], [ -99.492188, 39.977120 ], [ -99.316406, 39.977120 ], [ -99.316406, 39.909736 ], [ -100.019531, 39.909736 ], [ -100.019531, 39.977120 ] ] ] } } ] } ] } , @@ -49,7 +49,7 @@ , { "type": "Feature", "properties": { "name": "A" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -99.294434, 40.078071 ], [ -99.294434, 40.010787 ], [ -99.492188, 39.977120 ], [ -99.645996, 40.010787 ], [ -99.755859, 39.977120 ], [ -99.821777, 39.993956 ], [ -99.865723, 39.993956 ], [ -99.909668, 40.010787 ], [ -99.931641, 40.010787 ], [ -99.997559, 39.993956 ], [ -99.997559, 40.078071 ], [ -99.294434, 40.078071 ] ] ] } } , -{ "type": "Feature", "properties": { "name": "B" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -99.294434, 40.010787 ], [ -99.294434, 39.926588 ], [ -99.997559, 39.926588 ], [ -99.997559, 39.993956 ], [ -99.931641, 40.010787 ], [ -99.909668, 40.010787 ], [ -99.865723, 39.993956 ], [ -99.821777, 39.993956 ], [ -99.645996, 40.010787 ], [ -99.492188, 39.977120 ], [ -99.294434, 40.010787 ] ] ] } } +{ "type": "Feature", "properties": { "name": "B" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -99.909668, 40.010787 ], [ -99.865723, 39.993956 ], [ -99.821777, 39.993956 ], [ -99.755859, 39.977120 ], [ -99.645996, 40.010787 ], [ -99.492188, 39.977120 ], [ -99.294434, 40.010787 ], [ -99.294434, 39.926588 ], [ -99.997559, 39.926588 ], [ -99.997559, 39.993956 ], [ -99.931641, 40.010787 ], [ -99.909668, 40.010787 ] ] ] } } ] } ] } , @@ -95,7 +95,7 @@ , { "type": "Feature", "properties": { "name": "A" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -99.297180, 40.071766 ], [ -99.297180, 40.006580 ], [ -99.319153, 40.017098 ], [ -99.354858, 40.008683 ], [ -99.385071, 40.010787 ], [ -99.420776, 39.993956 ], [ -99.453735, 39.993956 ], [ -99.483948, 39.983434 ], [ -99.519653, 39.993956 ], [ -99.555359, 39.996060 ], [ -99.582825, 40.010787 ], [ -99.618530, 40.008683 ], [ -99.648743, 40.017098 ], [ -99.684448, 40.002372 ], [ -99.717407, 40.000268 ], [ -99.753113, 39.985538 ], [ -99.758606, 39.985538 ], [ -99.783325, 39.989747 ], [ -99.819031, 39.987643 ], [ -99.824524, 39.989747 ], [ -99.846497, 40.002372 ], [ -99.851990, 40.002372 ], [ -99.882202, 40.004476 ], [ -99.917908, 40.017098 ], [ -99.953613, 40.006580 ], [ -99.981079, 40.008683 ], [ -100.000305, 40.000268 ], [ -100.000305, 40.071766 ], [ -99.297180, 40.071766 ] ] ] } } , -{ "type": "Feature", "properties": { "name": "B" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -99.912415, 40.017098 ], [ -99.882202, 40.004476 ], [ -99.854736, 40.004476 ], [ -99.851990, 40.002372 ], [ -99.824524, 39.989747 ], [ -99.819031, 39.987643 ], [ -99.813538, 39.985538 ], [ -99.783325, 39.989747 ], [ -99.758606, 39.985538 ], [ -99.753113, 39.985538 ], [ -99.747620, 39.985538 ], [ -99.717407, 40.000268 ], [ -99.684448, 40.002372 ], [ -99.648743, 40.017098 ], [ -99.618530, 40.008683 ], [ -99.582825, 40.010787 ], [ -99.555359, 39.993956 ], [ -99.519653, 39.993956 ], [ -99.483948, 39.983434 ], [ -99.453735, 39.993956 ], [ -99.420776, 39.993956 ], [ -99.385071, 40.010787 ], [ -99.354858, 40.008683 ], [ -99.319153, 40.017098 ], [ -99.297180, 40.006580 ], [ -99.297180, 39.928695 ], [ -100.000305, 39.928695 ], [ -100.000305, 40.000268 ], [ -99.981079, 40.008683 ], [ -99.953613, 40.006580 ], [ -99.923401, 40.017098 ], [ -99.917908, 40.017098 ], [ -99.912415, 40.017098 ] ] ] } } +{ "type": "Feature", "properties": { "name": "B" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -99.319153, 40.017098 ], [ -99.297180, 40.006580 ], [ -99.297180, 39.928695 ], [ -100.000305, 39.928695 ], [ -100.000305, 40.000268 ], [ -99.981079, 40.008683 ], [ -99.953613, 40.006580 ], [ -99.917908, 40.017098 ], [ -99.882202, 40.004476 ], [ -99.851990, 40.002372 ], [ -99.824524, 39.989747 ], [ -99.819031, 39.987643 ], [ -99.813538, 39.985538 ], [ -99.783325, 39.989747 ], [ -99.758606, 39.985538 ], [ -99.753113, 39.985538 ], [ -99.747620, 39.985538 ], [ -99.717407, 40.000268 ], [ -99.684448, 40.002372 ], [ -99.648743, 40.017098 ], [ -99.618530, 40.008683 ], [ -99.582825, 40.010787 ], [ -99.555359, 39.993956 ], [ -99.519653, 39.993956 ], [ -99.483948, 39.983434 ], [ -99.453735, 39.993956 ], [ -99.420776, 39.993956 ], [ -99.385071, 40.010787 ], [ -99.354858, 40.008683 ], [ -99.319153, 40.017098 ] ] ] } } ] } ] } , @@ -111,7 +111,7 @@ , { "type": "Feature", "properties": { "name": "A" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -99.295807, 40.071766 ], [ -99.295807, 40.006580 ], [ -99.308167, 40.012891 ], [ -99.320526, 40.017098 ], [ -99.331512, 40.014994 ], [ -99.354858, 40.008683 ], [ -99.383698, 40.010787 ], [ -99.396057, 40.006580 ], [ -99.419403, 39.993956 ], [ -99.455109, 39.992904 ], [ -99.483948, 39.982382 ], [ -99.496307, 39.984486 ], [ -99.519653, 39.993956 ], [ -99.542999, 39.992904 ], [ -99.553986, 39.995008 ], [ -99.584198, 40.010787 ], [ -99.595184, 40.011839 ], [ -99.618530, 40.008683 ], [ -99.648743, 40.017098 ], [ -99.659729, 40.013943 ], [ -99.683075, 40.002372 ], [ -99.718781, 40.000268 ], [ -99.742126, 39.987643 ], [ -99.744873, 39.986591 ], [ -99.747620, 39.985538 ], [ -99.750366, 39.985538 ], [ -99.753113, 39.984486 ], [ -99.754486, 39.984486 ], [ -99.783325, 39.990799 ], [ -99.806671, 39.986591 ], [ -99.812164, 39.986591 ], [ -99.817657, 39.986591 ], [ -99.820404, 39.987643 ], [ -99.842377, 39.999216 ], [ -99.847870, 40.002372 ], [ -99.849243, 40.002372 ], [ -99.857483, 40.004476 ], [ -99.858856, 40.004476 ], [ -99.882202, 40.004476 ], [ -99.905548, 40.013943 ], [ -99.909668, 40.014994 ], [ -99.912415, 40.016046 ], [ -99.915161, 40.016046 ], [ -99.917908, 40.017098 ], [ -99.919281, 40.017098 ], [ -99.953613, 40.007632 ], [ -99.982452, 40.008683 ], [ -100.000305, 40.000268 ], [ -100.000305, 40.071766 ], [ -99.295807, 40.071766 ] ] ] } } , -{ "type": "Feature", "properties": { "name": "B" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -99.923401, 40.017098 ], [ -99.919281, 40.017098 ], [ -99.917908, 40.017098 ], [ -99.915161, 40.016046 ], [ -99.912415, 40.016046 ], [ -99.909668, 40.014994 ], [ -99.905548, 40.013943 ], [ -99.882202, 40.003424 ], [ -99.858856, 40.004476 ], [ -99.857483, 40.004476 ], [ -99.853363, 40.004476 ], [ -99.849243, 40.002372 ], [ -99.847870, 40.002372 ], [ -99.842377, 39.999216 ], [ -99.824524, 39.988695 ], [ -99.820404, 39.987643 ], [ -99.812164, 39.986591 ], [ -99.783325, 39.990799 ], [ -99.759979, 39.984486 ], [ -99.754486, 39.984486 ], [ -99.753113, 39.984486 ], [ -99.750366, 39.985538 ], [ -99.747620, 39.985538 ], [ -99.744873, 39.986591 ], [ -99.742126, 39.987643 ], [ -99.718781, 40.000268 ], [ -99.683075, 40.002372 ], [ -99.659729, 40.013943 ], [ -99.648743, 40.016046 ], [ -99.618530, 40.008683 ], [ -99.595184, 40.011839 ], [ -99.584198, 40.010787 ], [ -99.553986, 39.995008 ], [ -99.542999, 39.992904 ], [ -99.519653, 39.993956 ], [ -99.496307, 39.984486 ], [ -99.483948, 39.982382 ], [ -99.455109, 39.992904 ], [ -99.419403, 39.992904 ], [ -99.396057, 40.006580 ], [ -99.383698, 40.010787 ], [ -99.354858, 40.008683 ], [ -99.331512, 40.014994 ], [ -99.320526, 40.016046 ], [ -99.308167, 40.012891 ], [ -99.295807, 40.005528 ], [ -99.295807, 39.927642 ], [ -100.000305, 39.927642 ], [ -100.000305, 40.000268 ], [ -99.982452, 40.008683 ], [ -99.953613, 40.007632 ], [ -99.923401, 40.017098 ] ] ] } } +{ "type": "Feature", "properties": { "name": "B" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -99.917908, 40.017098 ], [ -99.915161, 40.016046 ], [ -99.912415, 40.016046 ], [ -99.909668, 40.014994 ], [ -99.905548, 40.013943 ], [ -99.882202, 40.003424 ], [ -99.858856, 40.004476 ], [ -99.857483, 40.004476 ], [ -99.849243, 40.002372 ], [ -99.847870, 40.002372 ], [ -99.842377, 39.999216 ], [ -99.824524, 39.988695 ], [ -99.820404, 39.987643 ], [ -99.817657, 39.986591 ], [ -99.812164, 39.986591 ], [ -99.806671, 39.986591 ], [ -99.783325, 39.990799 ], [ -99.759979, 39.984486 ], [ -99.754486, 39.984486 ], [ -99.753113, 39.984486 ], [ -99.750366, 39.985538 ], [ -99.747620, 39.985538 ], [ -99.744873, 39.986591 ], [ -99.742126, 39.987643 ], [ -99.718781, 40.000268 ], [ -99.683075, 40.002372 ], [ -99.659729, 40.013943 ], [ -99.648743, 40.016046 ], [ -99.618530, 40.008683 ], [ -99.595184, 40.011839 ], [ -99.584198, 40.010787 ], [ -99.553986, 39.995008 ], [ -99.542999, 39.992904 ], [ -99.519653, 39.993956 ], [ -99.496307, 39.984486 ], [ -99.483948, 39.982382 ], [ -99.455109, 39.992904 ], [ -99.419403, 39.992904 ], [ -99.396057, 40.006580 ], [ -99.383698, 40.010787 ], [ -99.354858, 40.008683 ], [ -99.331512, 40.014994 ], [ -99.320526, 40.016046 ], [ -99.308167, 40.012891 ], [ -99.295807, 40.005528 ], [ -99.295807, 39.927642 ], [ -100.000305, 39.927642 ], [ -100.000305, 40.000268 ], [ -99.982452, 40.008683 ], [ -99.953613, 40.007632 ], [ -99.919281, 40.017098 ], [ -99.917908, 40.017098 ] ] ] } } ] } ] } , diff --git a/tile.cpp b/tile.cpp index bb6849de..8035dc5e 100644 --- a/tile.cpp +++ b/tile.cpp @@ -2629,6 +2629,29 @@ long long write_tile(decompressor *geoms, std::atomic *geompos_in, ch } } + // After consistent snapping, give any area that is covered by more than one + // polygon in a layer (because rounding turned a narrow polygon between them + // inside out) to the one that comes first, as with other tiebreaks. + if (consistent_snapping) { + std::map>> layer_polygons; + for (auto const &f : features) { + if (f->t == VT_POLYGON && f->geometry.size() > 0) { + layer_polygons[f->layer].emplace_back(f->seq, &f->geometry); + } + } + for (auto &lp : layer_polygons) { + std::stable_sort(lp.second.begin(), lp.second.end(), [](std::pair const &a, std::pair const &b) { + return a.first < b.first; + }); + std::vector layer_geoms; + for (auto const &g : lp.second) { + layer_geoms.push_back(g.second); + } + auto hot = hot_pixels_by_layer.find(lp.first); + remove_overlaps(layer_geoms, hot != hot_pixels_by_layer.end() ? &hot->second : NULL); + } + } + for (size_t i = 0; i < features.size(); i++) { signed char t = features[i]->t; diff --git a/unit.cpp b/unit.cpp index 91d5aff1..fb1b3158 100644 --- a/unit.cpp +++ b/unit.cpp @@ -826,3 +826,40 @@ TEST_CASE("Consistent snapping doesn't make neighboring polygons' edges cross", } REQUIRE(crossings == 0); } + +TEST_CASE("Overlaps between polygons go to the earlier polygon", "[wagyu]") { + auto ring = [](std::vector> pts) { + drawvec g; + for (size_t i = 0; i < pts.size(); i++) { + g.push_back(draw(i == 0 ? VT_MOVETO : VT_LINETO, pts[i].first, pts[i].second)); + } + g.push_back(draw(VT_LINETO, pts[0].first, pts[0].second)); + if (get_area(g, 0, g.size()) < 0) { + std::reverse(g.begin(), g.end()); + g[0].op = VT_MOVETO; + g[g.size() - 1].op = VT_LINETO; + } + return g; + }; + + // Two squares that overlap in a 2x10 strip, without sharing any edges + drawvec first = ring({{0, 0}, {10, 0}, {10, 10}, {0, 10}}); + drawvec second = ring({{8, 0}, {20, 0}, {20, 10}, {8, 10}}); + // and one that shares a border with the first in the same direction, + // so that it covers the same triangle beside it + drawvec third = ring({{0, 10}, {10, 10}, {5, 5}}); + + // Clean them consistently first, as tippecanoe does, which splits + // each square's edges where the other's corners touch them + hot_pixel_list hot = layer_hot_pixels({&first, &second, &third}); + bool ok; + first = clean_polygon_with_hot_pixels(first, hot, &ok); + second = clean_polygon_with_hot_pixels(second, hot, &ok); + third = clean_polygon_with_hot_pixels(third, hot, &ok); + std::vector geoms = {&first, &second, &third}; + + REQUIRE(remove_overlaps(geoms, &hot) == 2); + REQUIRE(get_mp_area(first) == 100); + REQUIRE(get_mp_area(second) == 100); + REQUIRE(get_mp_area(third) == 0); +}