Files
tippecanoe/tests/wraparound2/out/-z0_--detect-longitude-wraparound.json
T
Claude 957b1cd9b9 Preserve spindle polygons as one-pixel-wide strips instead of letting them collapse
A polygon (or part of a polygon) narrower than a tile pixel, like a
1-meter buffer around a long linestring, used to collapse away to nothing
at most zoom levels when it was rounded to tile coordinates, except for
scattered fragments wherever the rounding happened to keep its two sides
apart.

Now, before the geometry is rounded, thin_polygon_strips() looks for edges
that have an oppositely-directed edge less than sqrt(2) tile units away
(the most that rounding can move two boundaries toward each other) and
that is not just the other side of a corner (the two points must also be
far apart along the ring). Candidate pairs are found with a sweep over the
edges' bounding boxes, so polygons without narrow parts cost little more
than sorting their edges. Each narrow edge gets a one-unit-wide strip, one
side of which is the edge as it will be rounded and the other side of which
is offset one unit toward the polygon's interior, so the strips lie within
the polygon wherever it is already thick enough, and they are unioned with
the cleaned polygon. The union is done at 16x resolution, because the
strips from the two sides of a spindle are nearly coincident and wagyu's
own snap rounding would otherwise collapse them in places.

Long, narrow polygons whose perimeter is more than 8 times the tiny polygon
size are also no longer combined into tiny-polygon squares, so a spindle
stays visible down to the zoom level where it is shorter than that.

--no-spindle-preservation restores the old behavior.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CQ6vQUJtmGZnqz7RmVYQaJ
2026-11-30 20:03:31 +00:00

21 lines
12 KiB
JSON

{ "type": "FeatureCollection", "properties": {
"antimeridian_adjusted_bounds": "-180.000000,12.583700,179.688000,85.051129",
"bounds": "-180.000000,12.583700,180.000000,85.051129",
"center": "0.000000,12.583700,0",
"description": "tests/wraparound2/out/-z0_--detect-longitude-wraparound.json.check.mbtiles",
"format": "pbf",
"generator_options": "./tippecanoe -q -a@ -f -o tests/wraparound2/out/-z0_--detect-longitude-wraparound.json.check.mbtiles -z0 --detect-longitude-wraparound tests/wraparound2/in.json",
"json": "{\"vector_layers\":[{\"id\":\"in\",\"description\":\"\",\"minzoom\":0,\"maxzoom\":0,\"fields\":{\"Code\":\"String\",\"LAYER\":\"String\",\"PlateName\":\"String\"}}],\"tilestats\":{\"layerCount\":1,\"layers\":[{\"layer\":\"in\",\"count\":1,\"geometry\":\"Polygon\",\"attributeCount\":3,\"attributes\":[{\"attribute\":\"Code\",\"count\":1,\"type\":\"string\",\"values\":[\"NA\"]},{\"attribute\":\"LAYER\",\"count\":1,\"type\":\"string\",\"values\":[\"plate\"]},{\"attribute\":\"PlateName\",\"count\":1,\"type\":\"string\",\"values\":[\"North America\"]}]}]}}",
"maxzoom": "0",
"minzoom": "0",
"name": "tests/wraparound2/out/-z0_--detect-longitude-wraparound.json.check.mbtiles",
"type": "overlay",
"version": "2"
}, "features": [
{ "type": "FeatureCollection", "properties": { "zoom": 0, "x": 0, "y": 0 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "properties": { "LAYER": "plate", "Code": "NA", "PlateName": "North America" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 81.474609, 85.628773 ], [ 81.650391, 85.622069 ], [ 187.031250, 85.622069 ], [ 187.031250, 51.013755 ], [ 185.097656, 50.847573 ], [ 183.779297, 50.569283 ], [ 182.285156, 50.457504 ], [ 180.000000, 50.513427 ], [ 179.648438, 50.513427 ], [ 177.714844, 50.680797 ], [ 172.968750, 51.672555 ], [ 171.826172, 52.052490 ], [ 168.837891, 53.225768 ], [ 168.222656, 53.592505 ], [ 167.431641, 53.904338 ], [ 166.376953, 54.213861 ], [ 164.882812, 54.977614 ], [ 164.091797, 55.229023 ], [ 162.597656, 56.413901 ], [ 164.970703, 58.904646 ], [ 169.013672, 60.283408 ], [ 170.771484, 61.731526 ], [ 168.662109, 61.606396 ], [ 166.728516, 61.396719 ], [ 164.970703, 61.354614 ], [ 163.388672, 61.227957 ], [ 159.345703, 61.312452 ], [ 153.984375, 61.731526 ], [ 149.677734, 63.587675 ], [ 144.931641, 65.293468 ], [ 143.701172, 66.302205 ], [ 141.240234, 66.964476 ], [ 139.394531, 67.908619 ], [ 138.515625, 69.037142 ], [ 136.757812, 69.960439 ], [ 135.615234, 70.699951 ], [ 134.033203, 71.856229 ], [ 132.451172, 72.685765 ], [ 130.166016, 74.019543 ], [ 128.935547, 74.936567 ], [ 127.177734, 77.235074 ], [ 125.683594, 78.134493 ], [ 125.156250, 78.988187 ], [ 123.398438, 79.765560 ], [ 121.025391, 81.120388 ], [ 119.970703, 81.595699 ], [ 119.091797, 82.082145 ], [ 117.773438, 82.297121 ], [ 115.751953, 83.015539 ], [ 113.730469, 83.510236 ], [ 111.972656, 83.820492 ], [ 110.917969, 83.970034 ], [ 108.896484, 84.196507 ], [ 99.404297, 84.912758 ], [ 96.855469, 85.051129 ], [ 95.800781, 85.103920 ], [ 92.285156, 85.229801 ], [ 88.505859, 85.345325 ], [ 81.650391, 85.615354 ], [ 18.281250, 85.615354 ], [ 16.083984, 85.485813 ], [ 13.271484, 85.280690 ], [ 11.689453, 85.133834 ], [ 10.546875, 85.051129 ], [ 9.843750, 84.959305 ], [ 8.964844, 85.013073 ], [ 8.173828, 84.897147 ], [ 4.482422, 84.566386 ], [ 4.042969, 84.599575 ], [ 3.867188, 84.558057 ], [ 2.988281, 84.465595 ], [ 0.439453, 84.097922 ], [ -0.439453, 83.997669 ], [ -2.373047, 83.686615 ], [ -4.130859, 83.430278 ], [ -5.185547, 83.246770 ], [ -6.240234, 83.004844 ], [ -7.207031, 82.864308 ], [ -5.888672, 82.687480 ], [ -5.009766, 82.517749 ], [ -3.691406, 82.332382 ], [ -5.009766, 81.910828 ], [ -3.867188, 81.621352 ], [ -4.658203, 81.374479 ], [ -2.373047, 81.120388 ], [ -3.339844, 80.788795 ], [ -1.669922, 80.618424 ], [ -2.373047, 80.371707 ], [ -0.263672, 80.148684 ], [ 3.251953, 79.655668 ], [ 4.394531, 79.528647 ], [ 3.427734, 79.038437 ], [ 7.822266, 78.242436 ], [ 7.734375, 77.915669 ], [ 7.910156, 77.711590 ], [ 7.646484, 77.157163 ], [ 7.470703, 76.268695 ], [ 7.646484, 75.737303 ], [ 7.910156, 75.386696 ], [ 8.613281, 74.936567 ], [ 9.140625, 74.378513 ], [ 9.228516, 73.971078 ], [ 9.052734, 73.751205 ], [ 8.613281, 73.528399 ], [ 5.625000, 72.919635 ], [ 2.812500, 72.422268 ], [ -3.691406, 71.385142 ], [ -4.042969, 71.497037 ], [ -4.746094, 71.328950 ], [ -5.712891, 71.552741 ], [ -5.888672, 71.469124 ], [ -6.943359, 71.272595 ], [ -7.382812, 71.130988 ], [ -11.337891, 71.773941 ], [ -12.392578, 71.244356 ], [ -11.337891, 71.045529 ], [ -12.216797, 70.554179 ], [ -12.919922, 70.699951 ], [ -13.886719, 70.815812 ], [ -14.414062, 70.348318 ], [ -14.765625, 70.377854 ], [ -16.523438, 68.815927 ], [ -17.138672, 68.879358 ], [ -17.841797, 68.399180 ], [ -19.072266, 67.067433 ], [ -18.105469, 66.930060 ], [ -18.281250, 66.791909 ], [ -17.490234, 66.687784 ], [ -17.753906, 66.372755 ], [ -16.523438, 66.196009 ], [ -17.050781, 65.366837 ], [ -17.138672, 64.997939 ], [ -17.402344, 64.736641 ], [ -17.841797, 64.472794 ], [ -19.248047, 63.860036 ], [ -21.269531, 64.052978 ], [ -22.851562, 63.782486 ], [ -23.027344, 63.665760 ], [ -23.291016, 63.665760 ], [ -24.521484, 63.114638 ], [ -25.136719, 62.714462 ], [ -25.488281, 62.633770 ], [ -28.652344, 60.586967 ], [ -28.916016, 60.326948 ], [ -29.882812, 59.756395 ], [ -30.761719, 58.950008 ], [ -30.937500, 58.995311 ], [ -31.552734, 58.447733 ], [ -31.904297, 58.355630 ], [ -32.255859, 57.984808 ], [ -32.431641, 57.984808 ], [ -32.783203, 57.657158 ], [ -32.958984, 57.657158 ], [ -33.222656, 57.279043 ], [ -33.486328, 57.279043 ], [ -33.574219, 56.897004 ], [ -34.013672, 56.897004 ], [ -34.013672, 56.800878 ], [ -34.453125, 56.511018 ], [ -34.628906, 55.825973 ], [ -34.892578, 55.825973 ], [ -35.332031, 54.977614 ], [ -35.244141, 54.927142 ], [ -35.507812, 54.316523 ], [ -35.156250, 54.316523 ], [ -35.419922, 53.644638 ], [ -35.419922, 53.540307 ], [ -35.244141, 53.488046 ], [ -35.332031, 53.225768 ], [ -35.156250, 53.225768 ], [ -35.156250, 52.696361 ], [ -33.310547, 52.643063 ], [ -31.552734, 52.482780 ], [ -31.289062, 52.429222 ], [ -31.289062, 52.106505 ], [ -30.058594, 52.052490 ], [ -29.882812, 50.792047 ], [ -29.531250, 50.457504 ], [ -29.003906, 50.176898 ], [ -29.003906, 49.894634 ], [ -28.828125, 49.667628 ], [ -28.564453, 49.610710 ], [ -28.037109, 48.632909 ], [ -27.773438, 48.574790 ], [ -27.597656, 47.635784 ], [ -27.421875, 47.635784 ], [ -27.509766, 47.279229 ], [ -27.333984, 46.980252 ], [ -27.509766, 46.195042 ], [ -27.773438, 45.890008 ], [ -27.949219, 45.151053 ], [ -28.125000, 45.089036 ], [ -28.300781, 44.276671 ], [ -28.476562, 44.213710 ], [ -28.476562, 43.834527 ], [ -28.828125, 43.771094 ], [ -29.179688, 43.068888 ], [ -29.355469, 43.068888 ], [ -29.443359, 42.293564 ], [ -29.179688, 42.293564 ], [ -29.179688, 41.705729 ], [ -29.355469, 41.244772 ], [ -29.267578, 40.713956 ], [ -29.355469, 40.580585 ], [ -29.619141, 40.580585 ], [ -29.531250, 40.446947 ], [ -29.794922, 39.368279 ], [ -30.410156, 38.410558 ], [ -30.585938, 38.410558 ], [ -31.113281, 37.649034 ], [ -31.376953, 37.718590 ], [ -31.552734, 37.300275 ], [ -32.255859, 37.370157 ], [ -32.695312, 37.020098 ], [ -32.958984, 37.090240 ], [ -33.046875, 36.949892 ], [ -33.222656, 36.949892 ], [ -33.310547, 36.668419 ], [ -33.574219, 36.738884 ], [ -33.750000, 36.173357 ], [ -34.013672, 36.244273 ], [ -34.716797, 35.029996 ], [ -36.386719, 35.245619 ], [ -36.650391, 34.669359 ], [ -36.826172, 34.741612 ], [ -36.826172, 34.524661 ], [ -37.089844, 34.597042 ], [ -37.265625, 34.089061 ], [ -37.353516, 34.161818 ], [ -37.529297, 33.724340 ], [ -37.705078, 33.724340 ], [ -37.792969, 33.504759 ], [ -39.375000, 33.797409 ], [ -39.550781, 33.063924 ], [ -39.726562, 33.063924 ], [ -40.517578, 31.802893 ], [ -40.693359, 31.802893 ], [ -41.220703, 31.203405 ], [ -41.396484, 31.203405 ], [ -42.099609, 29.993002 ], [ -42.714844, 30.069094 ], [ -44.033203, 28.071980 ], [ -44.912109, 26.037042 ], [ -45.087891, 26.115986 ], [ -45.527344, 25.165173 ], [ -45.791016, 25.244696 ], [ -46.230469, 24.607069 ], [ -46.494141, 23.885838 ], [ -44.912109, 23.644524 ], [ -45.263672, 21.779905 ], [ -45.351562, 21.861499 ], [ -45.527344, 21.207459 ], [ -45.527344, 20.632784 ], [ -45.791016, 20.632784 ], [ -46.142578, 18.895893 ], [ -46.406250, 18.396230 ], [ -46.582031, 16.636192 ], [ -46.494141, 16.551962 ], [ -46.757812, 15.453680 ], [ -47.724609, 15.961329 ], [ -49.218750, 16.045813 ], [ -50.449219, 15.876809 ], [ -51.064453, 16.045813 ], [ -53.437500, 16.972741 ], [ -54.843750, 17.308688 ], [ -56.777344, 18.729502 ], [ -57.480469, 19.062118 ], [ -58.271484, 19.228177 ], [ -59.941406, 19.476950 ], [ -61.523438, 18.979026 ], [ -63.369141, 19.725342 ], [ -66.269531, 19.808054 ], [ -68.027344, 19.725342 ], [ -68.818359, 19.559790 ], [ -71.279297, 20.220966 ], [ -73.212891, 20.303418 ], [ -75.761719, 19.973349 ], [ -81.738281, 18.895893 ], [ -81.650391, 17.811456 ], [ -83.671875, 17.476432 ], [ -86.308594, 16.720385 ], [ -88.330078, 15.961329 ], [ -88.857422, 15.623037 ], [ -89.384766, 15.199386 ], [ -90.791016, 13.410994 ], [ -90.878906, 12.554564 ], [ -92.021484, 13.239945 ], [ -92.285156, 13.239945 ], [ -92.988281, 13.752725 ], [ -93.339844, 13.752725 ], [ -95.800781, 15.284185 ], [ -97.207031, 15.368950 ], [ -98.173828, 15.623037 ], [ -100.898438, 16.636192 ], [ -104.765625, 18.396230 ], [ -105.732422, 19.145168 ], [ -106.259766, 19.890723 ], [ -106.347656, 20.879343 ], [ -106.787109, 21.453069 ], [ -106.875000, 21.779905 ], [ -108.105469, 21.698265 ], [ -108.632812, 21.943046 ], [ -108.544922, 22.268764 ], [ -108.017578, 22.998852 ], [ -108.632812, 23.241346 ], [ -108.369141, 23.644524 ], [ -109.248047, 24.367114 ], [ -109.072266, 24.686952 ], [ -110.039062, 25.324167 ], [ -109.775391, 25.562265 ], [ -110.742188, 26.194877 ], [ -110.742188, 26.431228 ], [ -111.533203, 26.902477 ], [ -111.357422, 27.137368 ], [ -111.533203, 27.215556 ], [ -111.357422, 27.527758 ], [ -113.115234, 28.690588 ], [ -113.378906, 28.921631 ], [ -113.291016, 28.998532 ], [ -113.994141, 29.611670 ], [ -113.730469, 29.840644 ], [ -114.082031, 30.145127 ], [ -113.818359, 30.297018 ], [ -114.433594, 31.128199 ], [ -114.082031, 31.353637 ], [ -115.312500, 32.398516 ], [ -115.224609, 32.546813 ], [ -115.576172, 32.842674 ], [ -115.488281, 32.990236 ], [ -115.751953, 33.137551 ], [ -115.576172, 33.211116 ], [ -115.751953, 33.431441 ], [ -116.630859, 34.016242 ], [ -118.037109, 34.597042 ], [ -119.355469, 34.957995 ], [ -122.695312, 37.857507 ], [ -123.310547, 38.548165 ], [ -124.453125, 40.313043 ], [ -124.716797, 40.313043 ], [ -124.980469, 40.647304 ], [ -124.892578, 40.913513 ], [ -125.332031, 41.640078 ], [ -125.332031, 42.293564 ], [ -125.156250, 42.488302 ], [ -125.507812, 43.452919 ], [ -125.332031, 44.087585 ], [ -125.419922, 45.089036 ], [ -126.123047, 47.338823 ], [ -126.474609, 47.989922 ], [ -127.001953, 48.574790 ], [ -127.617188, 48.864715 ], [ -128.056641, 49.781264 ], [ -129.023438, 50.457504 ], [ -129.462891, 50.625073 ], [ -129.990234, 51.124213 ], [ -130.869141, 51.618017 ], [ -132.714844, 53.120405 ], [ -133.857422, 54.367759 ], [ -134.121094, 54.826008 ], [ -135.878906, 56.607885 ], [ -137.109375, 58.447733 ], [ -139.394531, 60.108670 ], [ -140.097656, 60.370429 ], [ -141.064453, 60.326948 ], [ -142.382812, 60.457218 ], [ -144.316406, 59.933000 ], [ -145.722656, 59.265881 ], [ -146.777344, 58.355630 ], [ -148.271484, 57.326521 ], [ -150.117188, 56.607885 ], [ -152.226562, 56.072035 ], [ -155.214844, 54.775346 ], [ -156.181641, 54.521081 ], [ -159.345703, 53.852527 ], [ -162.421875, 53.383328 ], [ -163.916016, 52.961875 ], [ -170.859375, 51.289406 ], [ -173.320312, 50.958427 ], [ -174.902344, 50.847573 ], [ -176.220703, 50.569283 ], [ -177.714844, 50.457504 ], [ -180.000000, 50.513427 ], [ -180.087891, 50.513427 ], [ -182.285156, 50.680797 ], [ -187.031250, 51.672555 ], [ -187.031250, 85.622069 ], [ 18.281250, 85.622069 ], [ 18.369141, 85.628773 ], [ 18.369141, 85.622069 ], [ 81.474609, 85.622069 ], [ 81.474609, 85.628773 ] ] ] } }
] }
] }
] }