mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-06 10:25:41 +02:00
Polygon shards (#105)
* Put all of this back in geometry.cpp for conflict resolution * Stabilize line simplification to behave the same regardless of winding * Round instead of truncating when clipping lines * Restore non-Wagyu polygon clipping from prior to2fdec7d2* Make it round, not truncate, which reverts the last commit's test diffs * Clip in floating point, not integers, which makes no difference * Track nodes added at tile edges during clipping * Scale geometry up before wagyu to prevent changes from precision loss * Actually do the shared edge detection * Fix cases where nodes were not being added at the tile boundary * One more place I should have rounded * Narrow down where the discrepancy comes in * Revert "Narrow down where the discrepancy comes in" This reverts commit 221c4c5fc0ac9a6567e091c6a94b3d87dc8ade83. * Another attempt to narrow it down * The discrepancy seems to be introduced in reordering. No obvious bug * Was still truncating instead of rounding in projection * Also makes no difference... * Just forget that line reversal exists for a minute * Just reversal no coalescing * Try clipping in integers instead of floating point * Don't simplify after coalescing if they said no simplification * Check whether behavior is consistent with intentional simplification * Replace more floating point with integer * Are these three features enough to demonstrate the problem? * Add a few more nearby borders * All the features that touch tile 6/16/23 * Stay in integers in line simplification * More attempts to solve failures to simplify consistently * Fix most of the overflow errors * Fix known cases of integer overflow * All the tests change again * Pull clipping and scaling code back out into clip.cpp * Resolve the test conflicts * Stabilize choice of which three points to keep with different windings * Almost right, I think! * Fix collapse of islands to shards * Self-intersections in the same feature don't count * Revert "Self-intersections in the same feature don't count" This reverts commite04b19916e. * Don't scale down geometry if we are going to look for shared nodes * Fix the missing multiply that was keeping simplification from happening * Fix one more opportunity for overflow * Somehow I deleted this test? * Lost this test too * Clean up debugging printfs * Restore code sequence from main to make it reviewable * Remove unneeded rounding * Update documentation * This test is no longer useful * Back to floating point Douglas-Peucker to fix undersimplification * Try an older ubuntu * Revert "Try an older ubuntu" This reverts commit13fefacfd7. * Log OS info * Remove tests that are no longer needed * Oops, did need that one after all * Fix the arm vs x86 discrepancy? * Try another quantization * Cleanup from review * Add a test for the actual purpose of this PR
This commit is contained in:
@@ -88,7 +88,7 @@
|
||||
,
|
||||
{ "type": "FeatureCollection", "properties": { "zoom": 8, "x": 41, "y": 98 }, "features": [
|
||||
{ "type": "FeatureCollection", "properties": { "layer": "macarthur", "version": 2, "extent": 4096 }, "features": [
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.105484, 37.696861 ], [ -122.109261, 37.700936 ], [ -122.116814, 37.705553 ], [ -122.120934, 37.707183 ], [ -122.124710, 37.710171 ], [ -122.128830, 37.712615 ], [ -122.131233, 37.714788 ], [ -122.133293, 37.718590 ], [ -122.137413, 37.724836 ], [ -122.140503, 37.737327 ], [ -122.143936, 37.740313 ], [ -122.145653, 37.742757 ], [ -122.148743, 37.745472 ], [ -122.151489, 37.750087 ], [ -122.151489, 37.752801 ], [ -122.148056, 37.756873 ], [ -122.147713, 37.759587 ], [ -122.155266, 37.770986 ], [ -122.157326, 37.772886 ], [ -122.169342, 37.778856 ], [ -122.177582, 37.783469 ], [ -122.179642, 37.784011 ], [ -122.188568, 37.784283 ], [ -122.194061, 37.785911 ], [ -122.199898, 37.788895 ], [ -122.205048, 37.794050 ], [ -122.209511, 37.796221 ], [ -122.212944, 37.797306 ], [ -122.228394, 37.800832 ], [ -122.236633, 37.806258 ], [ -122.241783, 37.808428 ], [ -122.248306, 37.810326 ], [ -122.250023, 37.811683 ], [ -122.251396, 37.816565 ], [ -122.252769, 37.818192 ], [ -122.255859, 37.820633 ], [ -122.258949, 37.821989 ], [ -122.281609, 37.827413 ], [ -122.284012, 37.827413 ], [ -122.287445, 37.826599 ], [ -122.289848, 37.826870 ], [ -122.292938, 37.828497 ], [ -122.293282, 37.830938 ] ] } }
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.105484, 37.696861 ], [ -122.109261, 37.700936 ], [ -122.116814, 37.705553 ], [ -122.120934, 37.707183 ], [ -122.124710, 37.710171 ], [ -122.128830, 37.712615 ], [ -122.131233, 37.714788 ], [ -122.133293, 37.718590 ], [ -122.137413, 37.724836 ], [ -122.140503, 37.737327 ], [ -122.143936, 37.740313 ], [ -122.145653, 37.742757 ], [ -122.148743, 37.745472 ], [ -122.151489, 37.750087 ], [ -122.151489, 37.752801 ], [ -122.148056, 37.756873 ], [ -122.147713, 37.759587 ], [ -122.155266, 37.770986 ], [ -122.157326, 37.772886 ], [ -122.169342, 37.778856 ], [ -122.177582, 37.783469 ], [ -122.179642, 37.784011 ], [ -122.188568, 37.784283 ], [ -122.194061, 37.785911 ], [ -122.199898, 37.788895 ], [ -122.205048, 37.794050 ], [ -122.209511, 37.796221 ], [ -122.216721, 37.798391 ], [ -122.228394, 37.800832 ], [ -122.236633, 37.806258 ], [ -122.241783, 37.808428 ], [ -122.248306, 37.810326 ], [ -122.250023, 37.811683 ], [ -122.251396, 37.816565 ], [ -122.252769, 37.818192 ], [ -122.255859, 37.820633 ], [ -122.258949, 37.821989 ], [ -122.281609, 37.827413 ], [ -122.284012, 37.827413 ], [ -122.287445, 37.826599 ], [ -122.289848, 37.826870 ], [ -122.292938, 37.828497 ], [ -122.293282, 37.830938 ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.254829, 37.821446 ], [ -122.256889, 37.823345 ], [ -122.259293, 37.824701 ], [ -122.265816, 37.826599 ], [ -122.271652, 37.827413 ] ] } }
|
||||
,
|
||||
@@ -96,7 +96,7 @@
|
||||
,
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.252769, 37.817107 ], [ -122.252426, 37.816293 ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.294655, 37.833107 ], [ -122.293625, 37.828497 ], [ -122.290878, 37.826870 ], [ -122.287788, 37.826328 ], [ -122.283325, 37.827141 ], [ -122.280922, 37.827141 ], [ -122.258949, 37.821718 ], [ -122.254143, 37.819277 ], [ -122.252769, 37.817921 ], [ -122.251740, 37.816022 ], [ -122.250366, 37.811954 ], [ -122.248650, 37.810326 ], [ -122.238693, 37.806800 ], [ -122.234230, 37.804630 ], [ -122.228394, 37.800832 ], [ -122.216377, 37.798120 ], [ -122.209854, 37.796221 ], [ -122.204704, 37.793508 ], [ -122.200241, 37.788895 ], [ -122.193031, 37.785368 ], [ -122.188911, 37.784283 ], [ -122.178268, 37.783469 ], [ -122.157326, 37.772614 ], [ -122.155266, 37.770443 ], [ -122.148056, 37.759587 ], [ -122.148056, 37.757959 ], [ -122.148399, 37.756601 ], [ -122.151833, 37.752801 ], [ -122.151489, 37.750087 ], [ -122.148743, 37.744929 ], [ -122.145653, 37.742214 ], [ -122.143936, 37.740042 ], [ -122.140503, 37.737055 ], [ -122.137756, 37.725108 ], [ -122.133293, 37.718590 ], [ -122.131233, 37.714245 ], [ -122.129173, 37.712344 ], [ -122.124367, 37.709628 ], [ -122.121620, 37.707455 ], [ -122.111664, 37.702294 ], [ -122.108231, 37.699578 ], [ -122.105827, 37.696861 ] ] } }
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.294655, 37.833107 ], [ -122.293625, 37.828497 ], [ -122.290878, 37.826870 ], [ -122.287788, 37.826328 ], [ -122.283325, 37.827141 ], [ -122.280922, 37.827141 ], [ -122.258949, 37.821718 ], [ -122.254143, 37.819277 ], [ -122.252769, 37.817921 ], [ -122.251740, 37.816022 ], [ -122.250366, 37.811954 ], [ -122.248650, 37.810326 ], [ -122.238693, 37.806800 ], [ -122.234230, 37.804630 ], [ -122.228394, 37.800832 ], [ -122.216377, 37.798120 ], [ -122.209854, 37.796221 ], [ -122.204704, 37.793508 ], [ -122.200241, 37.788895 ], [ -122.193031, 37.785368 ], [ -122.188911, 37.784283 ], [ -122.178268, 37.783469 ], [ -122.157326, 37.772614 ], [ -122.155266, 37.770443 ], [ -122.148056, 37.759587 ], [ -122.148056, 37.757959 ], [ -122.148399, 37.756601 ], [ -122.151833, 37.752801 ], [ -122.151489, 37.750087 ], [ -122.148743, 37.744929 ], [ -122.145653, 37.742214 ], [ -122.140503, 37.737055 ], [ -122.137756, 37.725108 ], [ -122.133293, 37.718590 ], [ -122.131233, 37.714245 ], [ -122.129173, 37.712344 ], [ -122.124367, 37.709628 ], [ -122.121620, 37.707455 ], [ -122.111664, 37.702294 ], [ -122.108231, 37.699578 ], [ -122.105827, 37.696861 ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.241440, 37.807343 ], [ -122.237320, 37.805715 ] ] } }
|
||||
,
|
||||
@@ -132,7 +132,7 @@
|
||||
,
|
||||
{ "type": "FeatureCollection", "properties": { "zoom": 9, "x": 82, "y": 197 }, "features": [
|
||||
{ "type": "FeatureCollection", "properties": { "layer": "macarthur", "version": 2, "extent": 4096 }, "features": [
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.121449, 37.707726 ], [ -122.124882, 37.710307 ], [ -122.128315, 37.712072 ], [ -122.130375, 37.713702 ], [ -122.131405, 37.715060 ], [ -122.133121, 37.718590 ], [ -122.137241, 37.724836 ], [ -122.138271, 37.729724 ], [ -122.140503, 37.737327 ], [ -122.141190, 37.738277 ], [ -122.143764, 37.740313 ], [ -122.145481, 37.742621 ], [ -122.148743, 37.745200 ], [ -122.151318, 37.750222 ], [ -122.151661, 37.751580 ], [ -122.151489, 37.752801 ], [ -122.150803, 37.754158 ], [ -122.148399, 37.756466 ], [ -122.147713, 37.757823 ], [ -122.147713, 37.759587 ], [ -122.148743, 37.761623 ], [ -122.152519, 37.766644 ], [ -122.154579, 37.770172 ], [ -122.155437, 37.771258 ], [ -122.157326, 37.772886 ], [ -122.163849, 37.776414 ], [ -122.169514, 37.778856 ], [ -122.173977, 37.781298 ], [ -122.177582, 37.783604 ], [ -122.179642, 37.784011 ], [ -122.187881, 37.784283 ], [ -122.192173, 37.785232 ], [ -122.194405, 37.786046 ], [ -122.199726, 37.788895 ], [ -122.205048, 37.793915 ], [ -122.209511, 37.796221 ], [ -122.212944, 37.797441 ], [ -122.228909, 37.801104 ], [ -122.230110, 37.801782 ], [ -122.234230, 37.804901 ], [ -122.236462, 37.806122 ], [ -122.241955, 37.808563 ], [ -122.248821, 37.810598 ], [ -122.249508, 37.811140 ], [ -122.250195, 37.811954 ], [ -122.251396, 37.816293 ], [ -122.252598, 37.818056 ], [ -122.254314, 37.819548 ], [ -122.258778, 37.821989 ], [ -122.260838, 37.822667 ], [ -122.281437, 37.827548 ], [ -122.283669, 37.827548 ], [ -122.287445, 37.826735 ], [ -122.289677, 37.827006 ], [ -122.291393, 37.827548 ], [ -122.292767, 37.828362 ], [ -122.293453, 37.829853 ], [ -122.293282, 37.830938 ] ] } }
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.121449, 37.707726 ], [ -122.124882, 37.710307 ], [ -122.128315, 37.712072 ], [ -122.130375, 37.713702 ], [ -122.131405, 37.715060 ], [ -122.133121, 37.718590 ], [ -122.137241, 37.724836 ], [ -122.138271, 37.729724 ], [ -122.140503, 37.737327 ], [ -122.141190, 37.738277 ], [ -122.143764, 37.740313 ], [ -122.145481, 37.742621 ], [ -122.148743, 37.745200 ], [ -122.151318, 37.750222 ], [ -122.151661, 37.751580 ], [ -122.151489, 37.752801 ], [ -122.150803, 37.754158 ], [ -122.149086, 37.755651 ], [ -122.148056, 37.757144 ], [ -122.147713, 37.758501 ], [ -122.147713, 37.759587 ], [ -122.148743, 37.761623 ], [ -122.152519, 37.766644 ], [ -122.154579, 37.770172 ], [ -122.155437, 37.771258 ], [ -122.157326, 37.772886 ], [ -122.163849, 37.776414 ], [ -122.169514, 37.778856 ], [ -122.173977, 37.781298 ], [ -122.177582, 37.783604 ], [ -122.179642, 37.784011 ], [ -122.187881, 37.784283 ], [ -122.192173, 37.785232 ], [ -122.194405, 37.786046 ], [ -122.199726, 37.788895 ], [ -122.205048, 37.793915 ], [ -122.209511, 37.796221 ], [ -122.212944, 37.797441 ], [ -122.228909, 37.801104 ], [ -122.230110, 37.801782 ], [ -122.234230, 37.804901 ], [ -122.236462, 37.806122 ], [ -122.241955, 37.808563 ], [ -122.248821, 37.810598 ], [ -122.249508, 37.811140 ], [ -122.250195, 37.811954 ], [ -122.251396, 37.816293 ], [ -122.252598, 37.818056 ], [ -122.254314, 37.819548 ], [ -122.258778, 37.821989 ], [ -122.260838, 37.822667 ], [ -122.281437, 37.827548 ], [ -122.283669, 37.827548 ], [ -122.287445, 37.826735 ], [ -122.289677, 37.827006 ], [ -122.291393, 37.827548 ], [ -122.292767, 37.828362 ], [ -122.293453, 37.829853 ], [ -122.293282, 37.830938 ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.254658, 37.821446 ], [ -122.255173, 37.822124 ], [ -122.257404, 37.823752 ], [ -122.259293, 37.824565 ], [ -122.263584, 37.825650 ], [ -122.265816, 37.826599 ], [ -122.271652, 37.827548 ] ] } }
|
||||
,
|
||||
@@ -140,7 +140,7 @@
|
||||
,
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.252769, 37.817107 ], [ -122.252254, 37.816293 ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.294483, 37.832972 ], [ -122.293968, 37.831751 ], [ -122.293625, 37.828497 ], [ -122.292938, 37.827955 ], [ -122.291222, 37.827006 ], [ -122.289677, 37.826328 ], [ -122.287960, 37.826328 ], [ -122.282810, 37.827277 ], [ -122.280922, 37.827141 ], [ -122.268391, 37.824158 ], [ -122.261868, 37.822802 ], [ -122.259121, 37.821853 ], [ -122.254143, 37.819141 ], [ -122.252769, 37.817921 ], [ -122.251568, 37.816158 ], [ -122.250538, 37.812089 ], [ -122.249508, 37.810733 ], [ -122.248650, 37.810326 ], [ -122.242470, 37.808428 ], [ -122.238522, 37.806936 ], [ -122.234230, 37.804766 ], [ -122.230282, 37.801646 ], [ -122.228394, 37.800697 ], [ -122.216377, 37.798120 ], [ -122.210026, 37.796221 ], [ -122.204876, 37.793508 ], [ -122.200241, 37.788895 ], [ -122.193031, 37.785368 ], [ -122.190113, 37.784418 ], [ -122.188396, 37.784147 ], [ -122.179470, 37.783876 ], [ -122.178268, 37.783604 ], [ -122.170029, 37.778992 ], [ -122.163162, 37.775871 ], [ -122.157497, 37.772750 ], [ -122.155952, 37.771529 ], [ -122.154408, 37.769629 ], [ -122.152348, 37.766101 ], [ -122.148914, 37.761487 ], [ -122.147884, 37.759451 ], [ -122.147884, 37.757959 ], [ -122.148571, 37.756601 ], [ -122.150974, 37.754294 ], [ -122.151833, 37.752801 ], [ -122.151833, 37.751172 ], [ -122.151661, 37.750222 ], [ -122.149601, 37.746150 ], [ -122.148743, 37.744929 ], [ -122.145481, 37.742349 ], [ -122.143936, 37.740178 ], [ -122.141018, 37.737598 ], [ -122.140503, 37.736919 ], [ -122.138443, 37.729453 ], [ -122.137585, 37.724972 ], [ -122.137070, 37.723886 ], [ -122.134323, 37.720220 ], [ -122.133293, 37.718590 ], [ -122.131577, 37.714924 ], [ -122.130032, 37.713023 ], [ -122.128143, 37.711665 ], [ -122.124367, 37.709628 ], [ -122.121792, 37.707726 ] ] } }
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.294483, 37.832972 ], [ -122.293968, 37.831751 ], [ -122.293625, 37.828497 ], [ -122.292938, 37.827955 ], [ -122.291222, 37.827006 ], [ -122.289677, 37.826328 ], [ -122.287960, 37.826328 ], [ -122.282810, 37.827277 ], [ -122.280922, 37.827141 ], [ -122.268391, 37.824158 ], [ -122.261868, 37.822802 ], [ -122.259121, 37.821853 ], [ -122.254143, 37.819141 ], [ -122.252769, 37.817921 ], [ -122.251568, 37.816158 ], [ -122.250538, 37.812089 ], [ -122.249508, 37.810733 ], [ -122.248650, 37.810326 ], [ -122.242470, 37.808428 ], [ -122.238522, 37.806936 ], [ -122.234230, 37.804766 ], [ -122.230282, 37.801646 ], [ -122.228394, 37.800697 ], [ -122.216377, 37.798120 ], [ -122.210026, 37.796221 ], [ -122.204876, 37.793508 ], [ -122.200241, 37.788895 ], [ -122.193031, 37.785368 ], [ -122.190113, 37.784418 ], [ -122.188396, 37.784147 ], [ -122.179470, 37.783876 ], [ -122.178268, 37.783604 ], [ -122.170029, 37.778992 ], [ -122.163162, 37.775871 ], [ -122.157497, 37.772750 ], [ -122.155609, 37.771122 ], [ -122.154408, 37.769629 ], [ -122.152348, 37.766101 ], [ -122.148914, 37.761487 ], [ -122.147884, 37.759451 ], [ -122.147884, 37.757959 ], [ -122.148571, 37.756601 ], [ -122.150974, 37.754294 ], [ -122.151833, 37.752801 ], [ -122.151833, 37.751172 ], [ -122.151661, 37.750222 ], [ -122.149601, 37.746150 ], [ -122.148743, 37.744929 ], [ -122.145481, 37.742349 ], [ -122.143936, 37.740178 ], [ -122.141018, 37.737598 ], [ -122.140503, 37.736919 ], [ -122.138443, 37.729453 ], [ -122.137585, 37.724972 ], [ -122.137070, 37.723886 ], [ -122.134323, 37.720220 ], [ -122.133293, 37.718590 ], [ -122.131577, 37.714924 ], [ -122.130032, 37.713023 ], [ -122.128143, 37.711665 ], [ -122.124367, 37.709628 ], [ -122.121792, 37.707726 ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.241440, 37.807207 ], [ -122.240925, 37.806800 ], [ -122.239380, 37.806665 ], [ -122.238350, 37.805986 ], [ -122.237148, 37.805580 ] ] } }
|
||||
,
|
||||
@@ -162,7 +162,7 @@
|
||||
,
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.158871, 37.749951 ], [ -122.157669, 37.748186 ] ] } }
|
||||
,
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.142906, 37.738141 ], [ -122.151318, 37.742214 ], [ -122.153378, 37.743978 ], [ -122.156296, 37.746015 ], [ -122.157154, 37.747372 ] ] } }
|
||||
{ "type": "Feature", "properties": { }, "geometry": { "type": "LineString", "coordinates": [ [ -122.142906, 37.738141 ], [ -122.151318, 37.742214 ], [ -122.154751, 37.745064 ], [ -122.156296, 37.746015 ], [ -122.157154, 37.747372 ] ] } }
|
||||
] }
|
||||
] }
|
||||
] }
|
||||
|
||||
Reference in New Issue
Block a user