mirror of
https://github.com/felt/tippecanoe.git
synced 2026-12-05 06:41:41 +01:00
Don't let wagyu snap edges to hot pixels whose corners they only touch
Wagyu's snap rounding finds the hot pixels (pixels containing a vertex or intersection) that each edge passes through, row by row, by rounding the x range that the edge covers within the row outward. A value exactly halfway between two integers was rounded outward too, so a pixel whose corner the edge merely touched counted as one it passed through. For a 45-degree edge, the x range always ends exactly on pixel corners, so two parallel diagonal edges one unit apart were each snapped to the other's endpoints, and a perfectly valid diagonal polygon one unit wide (for example, a narrow Census block between two others, after rounding to tile coordinates) was collapsed to nothing by cleaning, leaving a diagonal gap between the blocks on either side of it. Round halfway values inward instead, for this purpose only (the rounding of intersection points is unchanged). On Dane County census blocks at -D8 -d8 -pn -pt, this removes about 10-20% of the gaps between blocks at z9 and z10, without introducing any self-intersecting polygons (checked independently with exact orientation tests at z6-z12). Upstream wagyu's rounding is unchanged since 2020. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CQ6vQUJtmGZnqz7RmVYQaJ
This commit is contained in:
@@ -111,7 +111,7 @@
|
||||
,
|
||||
{ "type": "FeatureCollection", "properties": { "zoom": 9, "x": 81, "y": 198 }, "features": [
|
||||
{ "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [
|
||||
{ "type": "Feature", "properties": { "r": 1 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -122.438507, 37.708949 ], [ -122.434731, 37.708541 ], [ -122.430954, 37.707726 ], [ -122.418594, 37.703652 ], [ -122.414646, 37.702701 ], [ -122.411041, 37.702022 ], [ -122.405376, 37.701615 ], [ -122.393017, 37.701479 ], [ -122.387352, 37.700800 ], [ -122.382717, 37.699442 ], [ -122.381516, 37.698898 ], [ -122.369499, 37.694280 ], [ -122.366581, 37.693465 ], [ -122.362804, 37.692786 ], [ -122.359028, 37.692514 ], [ -122.355251, 37.692650 ], [ -122.343750, 37.694280 ], [ -122.339115, 37.694688 ], [ -122.336369, 37.694688 ], [ -122.330017, 37.694280 ], [ -122.330017, 37.694009 ], [ -122.336369, 37.694416 ], [ -122.340145, 37.694416 ], [ -122.343750, 37.694009 ], [ -122.353363, 37.692514 ], [ -122.357140, 37.692243 ], [ -122.359886, 37.692243 ], [ -122.363663, 37.692650 ], [ -122.366581, 37.693194 ], [ -122.370358, 37.694416 ], [ -122.380829, 37.698491 ], [ -122.386494, 37.700257 ], [ -122.390270, 37.700936 ], [ -122.394047, 37.701343 ], [ -122.406235, 37.701343 ], [ -122.412071, 37.701886 ], [ -122.412758, 37.702158 ], [ -122.414646, 37.702566 ], [ -122.414818, 37.702566 ], [ -122.418594, 37.703516 ], [ -122.430954, 37.707455 ], [ -122.433701, 37.708134 ], [ -122.437477, 37.708541 ], [ -122.440395, 37.708677 ], [ -122.444172, 37.708270 ], [ -122.457390, 37.705282 ], [ -122.463055, 37.704467 ], [ -122.467861, 37.704331 ], [ -122.468719, 37.704331 ], [ -122.479191, 37.704874 ], [ -122.484856, 37.704603 ], [ -122.491207, 37.703245 ], [ -122.491722, 37.703109 ], [ -122.499962, 37.699849 ], [ -122.499962, 37.700121 ], [ -122.492409, 37.703109 ], [ -122.491722, 37.703245 ], [ -122.491550, 37.703380 ], [ -122.491207, 37.703380 ], [ -122.491207, 37.703516 ], [ -122.488632, 37.704195 ], [ -122.485714, 37.704739 ], [ -122.481937, 37.705146 ], [ -122.479191, 37.705146 ], [ -122.468033, 37.704467 ], [ -122.463055, 37.704603 ], [ -122.458420, 37.705282 ], [ -122.444172, 37.708541 ], [ -122.438507, 37.708949 ] ], [ [ -122.343750, 37.694144 ], [ -122.355251, 37.692514 ], [ -122.353363, 37.692650 ], [ -122.343750, 37.694144 ] ], [ [ -122.484169, 37.704739 ], [ -122.479191, 37.705010 ], [ -122.481937, 37.705010 ], [ -122.484169, 37.704739 ] ], [ [ -122.386494, 37.700392 ], [ -122.387352, 37.700664 ], [ -122.389240, 37.700936 ], [ -122.386494, 37.700392 ] ] ] } }
|
||||
{ "type": "Feature", "properties": { "r": 1 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -122.438507, 37.708949 ], [ -122.434731, 37.708541 ], [ -122.430954, 37.707726 ], [ -122.418594, 37.703652 ], [ -122.414646, 37.702701 ], [ -122.411041, 37.702022 ], [ -122.405376, 37.701615 ], [ -122.393017, 37.701479 ], [ -122.387352, 37.700800 ], [ -122.382717, 37.699442 ], [ -122.381516, 37.698898 ], [ -122.369499, 37.694280 ], [ -122.366581, 37.693465 ], [ -122.362804, 37.692786 ], [ -122.359028, 37.692514 ], [ -122.355251, 37.692650 ], [ -122.343750, 37.694280 ], [ -122.339115, 37.694688 ], [ -122.336369, 37.694688 ], [ -122.330017, 37.694280 ], [ -122.330017, 37.694009 ], [ -122.336369, 37.694416 ], [ -122.340145, 37.694416 ], [ -122.343750, 37.694009 ], [ -122.353363, 37.692514 ], [ -122.357140, 37.692243 ], [ -122.359886, 37.692243 ], [ -122.363663, 37.692650 ], [ -122.366581, 37.693194 ], [ -122.370358, 37.694416 ], [ -122.380829, 37.698491 ], [ -122.386494, 37.700257 ], [ -122.390270, 37.700936 ], [ -122.394047, 37.701343 ], [ -122.406235, 37.701343 ], [ -122.412071, 37.701886 ], [ -122.414646, 37.702566 ], [ -122.414818, 37.702566 ], [ -122.418594, 37.703516 ], [ -122.430954, 37.707455 ], [ -122.433701, 37.708134 ], [ -122.437477, 37.708541 ], [ -122.440395, 37.708677 ], [ -122.444172, 37.708270 ], [ -122.457390, 37.705282 ], [ -122.463055, 37.704467 ], [ -122.467861, 37.704331 ], [ -122.468719, 37.704331 ], [ -122.479191, 37.704874 ], [ -122.484856, 37.704603 ], [ -122.491207, 37.703245 ], [ -122.491722, 37.703109 ], [ -122.499962, 37.699849 ], [ -122.499962, 37.700121 ], [ -122.492409, 37.703109 ], [ -122.491722, 37.703245 ], [ -122.491550, 37.703380 ], [ -122.491207, 37.703380 ], [ -122.491207, 37.703516 ], [ -122.488632, 37.704195 ], [ -122.485714, 37.704739 ], [ -122.481937, 37.705146 ], [ -122.479191, 37.705146 ], [ -122.468033, 37.704467 ], [ -122.463055, 37.704603 ], [ -122.458420, 37.705282 ], [ -122.444172, 37.708541 ], [ -122.438507, 37.708949 ] ], [ [ -122.343750, 37.694144 ], [ -122.355251, 37.692514 ], [ -122.353363, 37.692650 ], [ -122.343750, 37.694144 ] ], [ [ -122.484169, 37.704739 ], [ -122.479191, 37.705010 ], [ -122.481937, 37.705010 ], [ -122.484169, 37.704739 ] ], [ [ -122.386494, 37.700392 ], [ -122.387352, 37.700664 ], [ -122.389240, 37.700936 ], [ -122.386494, 37.700392 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "r": 3 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -122.386494, 37.729588 ], [ -122.376194, 37.725379 ], [ -122.374477, 37.724836 ], [ -122.373104, 37.724429 ], [ -122.369328, 37.723750 ], [ -122.366753, 37.723614 ], [ -122.364864, 37.723479 ], [ -122.362804, 37.723614 ], [ -122.352333, 37.724701 ], [ -122.346668, 37.724836 ], [ -122.345638, 37.724836 ], [ -122.344093, 37.724701 ], [ -122.341862, 37.724565 ], [ -122.340660, 37.724429 ], [ -122.337227, 37.723750 ], [ -122.330017, 37.722528 ], [ -122.330017, 37.722257 ], [ -122.337227, 37.723614 ], [ -122.340660, 37.724293 ], [ -122.344093, 37.724565 ], [ -122.346325, 37.724701 ], [ -122.351303, 37.724565 ], [ -122.363663, 37.723343 ], [ -122.365551, 37.723343 ], [ -122.366753, 37.723479 ], [ -122.368469, 37.723479 ], [ -122.372246, 37.724022 ], [ -122.374477, 37.724701 ], [ -122.376022, 37.725108 ], [ -122.376194, 37.725244 ], [ -122.376881, 37.725379 ], [ -122.386494, 37.729317 ], [ -122.386494, 37.729588 ] ] ] } }
|
||||
] }
|
||||
@@ -163,7 +163,7 @@
|
||||
,
|
||||
{ "type": "FeatureCollection", "properties": { "zoom": 10, "x": 164, "y": 396 }, "features": [
|
||||
{ "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [
|
||||
{ "type": "Feature", "properties": { "r": 1 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -122.235088, 37.708881 ], [ -122.233200, 37.708745 ], [ -122.230368, 37.708270 ], [ -122.226591, 37.707387 ], [ -122.219896, 37.705621 ], [ -122.216120, 37.704807 ], [ -122.216120, 37.704671 ], [ -122.218952, 37.705282 ], [ -122.227020, 37.707387 ], [ -122.228479, 37.707726 ], [ -122.232256, 37.708473 ], [ -122.236032, 37.708813 ], [ -122.239809, 37.708677 ], [ -122.243500, 37.708066 ], [ -122.243757, 37.707998 ], [ -122.246418, 37.707387 ], [ -122.255859, 37.704331 ], [ -122.258692, 37.703516 ], [ -122.262468, 37.702701 ], [ -122.263241, 37.702633 ], [ -122.263412, 37.702566 ], [ -122.264099, 37.702498 ], [ -122.266331, 37.702226 ], [ -122.269163, 37.702090 ], [ -122.270107, 37.702090 ], [ -122.273369, 37.702158 ], [ -122.277231, 37.702226 ], [ -122.279549, 37.702158 ], [ -122.281437, 37.702158 ], [ -122.284527, 37.701886 ], [ -122.285471, 37.701751 ], [ -122.288046, 37.701275 ], [ -122.291822, 37.700257 ], [ -122.292767, 37.699917 ], [ -122.293968, 37.699510 ], [ -122.302208, 37.696182 ], [ -122.302895, 37.695978 ], [ -122.304783, 37.695231 ], [ -122.305984, 37.694756 ], [ -122.306843, 37.694484 ], [ -122.308903, 37.693873 ], [ -122.312679, 37.693058 ], [ -122.313023, 37.693058 ], [ -122.316456, 37.692718 ], [ -122.319288, 37.692718 ], [ -122.321177, 37.692922 ], [ -122.323065, 37.693058 ], [ -122.331734, 37.694212 ], [ -122.333794, 37.694416 ], [ -122.336283, 37.694552 ], [ -122.339802, 37.694484 ], [ -122.343750, 37.694144 ], [ -122.350531, 37.693058 ], [ -122.350616, 37.693058 ], [ -122.350616, 37.693126 ], [ -122.343750, 37.694212 ], [ -122.340059, 37.694552 ], [ -122.339802, 37.694552 ], [ -122.339115, 37.694620 ], [ -122.335339, 37.694620 ], [ -122.333794, 37.694484 ], [ -122.332506, 37.694416 ], [ -122.331734, 37.694280 ], [ -122.330618, 37.694212 ], [ -122.324009, 37.693329 ], [ -122.320232, 37.692922 ], [ -122.317400, 37.692786 ], [ -122.313623, 37.693058 ], [ -122.309847, 37.693737 ], [ -122.306843, 37.694552 ], [ -122.306070, 37.694824 ], [ -122.305040, 37.695231 ], [ -122.294655, 37.699374 ], [ -122.293968, 37.699578 ], [ -122.293711, 37.699713 ], [ -122.292767, 37.699985 ], [ -122.290878, 37.700664 ], [ -122.288990, 37.701207 ], [ -122.286158, 37.701751 ], [ -122.285471, 37.701819 ], [ -122.285213, 37.701886 ], [ -122.284698, 37.701954 ], [ -122.282381, 37.702226 ], [ -122.279549, 37.702226 ], [ -122.277660, 37.702294 ], [ -122.276716, 37.702294 ], [ -122.273369, 37.702226 ], [ -122.269850, 37.702158 ], [ -122.266245, 37.702362 ], [ -122.264099, 37.702566 ], [ -122.263241, 37.702701 ], [ -122.257748, 37.703856 ], [ -122.249250, 37.706640 ], [ -122.245474, 37.707726 ], [ -122.241697, 37.708541 ], [ -122.238865, 37.708881 ], [ -122.235088, 37.708881 ] ], [ [ -122.235088, 37.708813 ], [ -122.232513, 37.708541 ], [ -122.233200, 37.708677 ], [ -122.235088, 37.708813 ] ], [ [ -122.240925, 37.708541 ], [ -122.241697, 37.708473 ], [ -122.242298, 37.708338 ], [ -122.240925, 37.708541 ] ], [ [ -122.239294, 37.708745 ], [ -122.237921, 37.708813 ], [ -122.238865, 37.708813 ], [ -122.239294, 37.708745 ] ] ] } }
|
||||
{ "type": "Feature", "properties": { "r": 1 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -122.235088, 37.708881 ], [ -122.233200, 37.708745 ], [ -122.230368, 37.708270 ], [ -122.226591, 37.707387 ], [ -122.219896, 37.705621 ], [ -122.216120, 37.704807 ], [ -122.216120, 37.704671 ], [ -122.218952, 37.705282 ], [ -122.227020, 37.707387 ], [ -122.228479, 37.707726 ], [ -122.232256, 37.708473 ], [ -122.236032, 37.708813 ], [ -122.239809, 37.708677 ], [ -122.243500, 37.708066 ], [ -122.243757, 37.707998 ], [ -122.246418, 37.707387 ], [ -122.255859, 37.704331 ], [ -122.258692, 37.703516 ], [ -122.262468, 37.702701 ], [ -122.263241, 37.702633 ], [ -122.263412, 37.702566 ], [ -122.264099, 37.702498 ], [ -122.266331, 37.702226 ], [ -122.269163, 37.702090 ], [ -122.270107, 37.702090 ], [ -122.273369, 37.702158 ], [ -122.277231, 37.702226 ], [ -122.279549, 37.702158 ], [ -122.281437, 37.702158 ], [ -122.284527, 37.701886 ], [ -122.285471, 37.701751 ], [ -122.288046, 37.701275 ], [ -122.291822, 37.700257 ], [ -122.292767, 37.699917 ], [ -122.293968, 37.699510 ], [ -122.302208, 37.696182 ], [ -122.304783, 37.695231 ], [ -122.305984, 37.694756 ], [ -122.306843, 37.694484 ], [ -122.308903, 37.693873 ], [ -122.312679, 37.693058 ], [ -122.313023, 37.693058 ], [ -122.316456, 37.692718 ], [ -122.319288, 37.692718 ], [ -122.321177, 37.692922 ], [ -122.323065, 37.693058 ], [ -122.331734, 37.694212 ], [ -122.333794, 37.694416 ], [ -122.336283, 37.694552 ], [ -122.339802, 37.694484 ], [ -122.343750, 37.694144 ], [ -122.350531, 37.693058 ], [ -122.350616, 37.693058 ], [ -122.350616, 37.693126 ], [ -122.343750, 37.694212 ], [ -122.340059, 37.694552 ], [ -122.339802, 37.694552 ], [ -122.339115, 37.694620 ], [ -122.335339, 37.694620 ], [ -122.333794, 37.694484 ], [ -122.332506, 37.694416 ], [ -122.331734, 37.694280 ], [ -122.330618, 37.694212 ], [ -122.324009, 37.693329 ], [ -122.320232, 37.692922 ], [ -122.317400, 37.692786 ], [ -122.313623, 37.693058 ], [ -122.309847, 37.693737 ], [ -122.306843, 37.694552 ], [ -122.306070, 37.694824 ], [ -122.305040, 37.695231 ], [ -122.294655, 37.699374 ], [ -122.293968, 37.699578 ], [ -122.293711, 37.699713 ], [ -122.292767, 37.699985 ], [ -122.290878, 37.700664 ], [ -122.288990, 37.701207 ], [ -122.286158, 37.701751 ], [ -122.285471, 37.701819 ], [ -122.285213, 37.701886 ], [ -122.284698, 37.701954 ], [ -122.282381, 37.702226 ], [ -122.279549, 37.702226 ], [ -122.277660, 37.702294 ], [ -122.276716, 37.702294 ], [ -122.273369, 37.702226 ], [ -122.269850, 37.702158 ], [ -122.266245, 37.702362 ], [ -122.264099, 37.702566 ], [ -122.263241, 37.702701 ], [ -122.257748, 37.703856 ], [ -122.249250, 37.706640 ], [ -122.245474, 37.707726 ], [ -122.241697, 37.708541 ], [ -122.238865, 37.708881 ], [ -122.235088, 37.708881 ] ], [ [ -122.235088, 37.708813 ], [ -122.232513, 37.708541 ], [ -122.233200, 37.708677 ], [ -122.235088, 37.708813 ] ], [ [ -122.288303, 37.701275 ], [ -122.288990, 37.701139 ], [ -122.290878, 37.700596 ], [ -122.288303, 37.701275 ] ], [ [ -122.240925, 37.708541 ], [ -122.241697, 37.708473 ], [ -122.242298, 37.708338 ], [ -122.240925, 37.708541 ] ], [ [ -122.239294, 37.708745 ], [ -122.237921, 37.708813 ], [ -122.238865, 37.708813 ], [ -122.239294, 37.708745 ] ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { "r": 3 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -122.312422, 37.724090 ], [ -122.312422, 37.723954 ], [ -122.315426, 37.723071 ], [ -122.318258, 37.722392 ], [ -122.321091, 37.721985 ], [ -122.321692, 37.721985 ], [ -122.322035, 37.721917 ], [ -122.322464, 37.721917 ], [ -122.323923, 37.721849 ], [ -122.325811, 37.721985 ], [ -122.327013, 37.721985 ], [ -122.327700, 37.722053 ], [ -122.329588, 37.722324 ], [ -122.329931, 37.722392 ], [ -122.330532, 37.722460 ], [ -122.335424, 37.723343 ], [ -122.338858, 37.723954 ], [ -122.350616, 37.723954 ], [ -122.350616, 37.724022 ], [ -122.339115, 37.724022 ], [ -122.339115, 37.724090 ], [ -122.335424, 37.723411 ], [ -122.329931, 37.722460 ], [ -122.327013, 37.722053 ], [ -122.325811, 37.722053 ], [ -122.324867, 37.721985 ], [ -122.322464, 37.721985 ], [ -122.321692, 37.722053 ], [ -122.319202, 37.722324 ], [ -122.315426, 37.723139 ], [ -122.312422, 37.724090 ] ] ] } }
|
||||
] }
|
||||
|
||||
Reference in New Issue
Block a user