From a8de40ddb435405ec0d9cb003e487f71f1cb94af Mon Sep 17 00:00:00 2001 From: James Beard Date: Thu, 2 Nov 2023 15:22:20 +1100 Subject: [PATCH] Fix turf-line-arc to generate the correct number of steps in the generated arc (#2525) * Fixes #2524 where lineArc isn't dividing the arc into the correct number of steps. Also a bit related to #2446, which should have been fixed a while ago by a previous fix to the previous version of this code (see #2142). Including a unit test to make sure we don't go backwards with this approach. * Flow on changes to turf-sector and turf-angle unit test outputs as a result of fix to turf-line-arc. All changes checked visually using geojson.io, noting start and end coords are identical and it's only the intermediate ones changing due to the curve being smoother by default. * Update changelog. * Clarifying what the "steps" param means in the documentation. Haven't rebuilt the readme as generate-readmes needs some work. Will make that a seperate PR though. --- CHANGELOG.md | 1 + packages/turf-angle/test/out/90-degrees.json | 189 ++++++++++++------ .../turf-angle/test/out/acute-inverse.json | 189 ++++++++++++------ packages/turf-angle/test/out/acute.json | 189 ++++++++++++------ .../turf-angle/test/out/obtuse-bigger.json | 189 ++++++++++++------ packages/turf-angle/test/out/obtuse.json | 189 ++++++++++++------ packages/turf-line-arc/index.ts | 26 ++- packages/turf-line-arc/test.js | 48 ++++- .../test/in/line-arc-one-step.geojson | 13 ++ .../test/in/line-arc-zero-steps.geojson | 13 ++ .../turf-line-arc/test/in/line-arc7.geojson | 12 ++ .../test/out/line-arc-greater-360.geojson | 60 ++++++ .../test/out/line-arc-one-step.geojson | 34 ++++ .../test/out/line-arc-zero-steps.geojson | 97 +++++++++ .../turf-line-arc/test/out/line-arc1.geojson | 56 ++++++ .../turf-line-arc/test/out/line-arc2.geojson | 72 +++++-- .../turf-line-arc/test/out/line-arc3.geojson | 80 +++++--- .../turf-line-arc/test/out/line-arc4.geojson | 69 ++++++- .../turf-line-arc/test/out/line-arc5.geojson | 120 +++++------ .../turf-line-arc/test/out/line-arc6.geojson | 105 +++++----- .../turf-line-arc/test/out/line-arc7.geojson | 95 +++++++++ packages/turf-sector/test/out/pacman.geojson | 112 ++++++----- .../test/out/sector-greater-360.geojson | 60 ++++++ packages/turf-sector/test/out/sector1.geojson | 56 ++++++ packages/turf-sector/test/out/sector2.geojson | 72 +++++-- packages/turf-sector/test/out/sector3.geojson | 80 +++++--- packages/turf-sector/test/out/sector4.geojson | 69 ++++++- packages/turf-sector/test/out/sector5.geojson | 120 +++++------ packages/turf-sector/test/out/sector6.geojson | 105 +++++----- 29 files changed, 1818 insertions(+), 702 deletions(-) create mode 100644 packages/turf-line-arc/test/in/line-arc-one-step.geojson create mode 100644 packages/turf-line-arc/test/in/line-arc-zero-steps.geojson create mode 100644 packages/turf-line-arc/test/in/line-arc7.geojson create mode 100644 packages/turf-line-arc/test/out/line-arc-one-step.geojson create mode 100644 packages/turf-line-arc/test/out/line-arc-zero-steps.geojson create mode 100644 packages/turf-line-arc/test/out/line-arc7.geojson diff --git a/CHANGELOG.md b/CHANGELOG.md index 01576deb8b..f96cbe32d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,7 @@ We intend to keep making breaking changes before 7.0.0 is fully released. If you - [`@turf/random`](random) Throws error on invalid bbox inputs (#2172) - [`@turf/boolean-parallel`](boolean-parallel) Lines with 180 degree angle between them are also considered parallel (#2475) - [`@turf/unkink-polygon`](unkink-polygon) Fix a maximum call stack size exceeded error with very large polygons (#2504) +- [`@turf/line-arc`](line-arc) Number of arc segments generated wasn't related to steps value passed in (#2524) ## 📖 Documentation - [`@turf/bbox`][bbox] Improve documentation (#2153) diff --git a/packages/turf-angle/test/out/90-degrees.json b/packages/turf-angle/test/out/90-degrees.json index 7d04e7cbbd..4265337bb9 100644 --- a/packages/turf-angle/test/out/90-degrees.json +++ b/packages/turf-angle/test/out/90-degrees.json @@ -17,22 +17,69 @@ [ [124, -22], [124, -20.333333], - [124.174203, -20.341268], - [124.346782, -20.364998], - [124.51613, -20.404302], - [124.680665, -20.458813], - [124.838844, -20.528022], - [124.989183, -20.611283], - [125.130261, -20.707815], - [125.260739, -20.816714], - [125.379367, -20.936957], - [125.485003, -21.067412], - [125.576614, -21.206849], - [125.653297, -21.353949], - [125.714277, -21.507317], - [125.758928, -21.665495], - [125.786768, -21.826973], - [125.797475, -21.990207], + [124.04425, -20.333844], + [124.088474, -20.335376], + [124.132644, -20.337929], + [124.176735, -20.341501], + [124.22072, -20.346089], + [124.264573, -20.351692], + [124.308266, -20.358305], + [124.351775, -20.365925], + [124.395073, -20.374547], + [124.438134, -20.384166], + [124.480932, -20.394777], + [124.523441, -20.406372], + [124.565636, -20.418945], + [124.607491, -20.432488], + [124.648981, -20.446993], + [124.690081, -20.462452], + [124.730767, -20.478855], + [124.771013, -20.496192], + [124.810795, -20.514453], + [124.850089, -20.533627], + [124.888872, -20.553702], + [124.92712, -20.574667], + [124.964809, -20.596508], + [125.001917, -20.619212], + [125.038421, -20.642766], + [125.074299, -20.667156], + [125.109529, -20.692366], + [125.144089, -20.718382], + [125.177958, -20.745187], + [125.211115, -20.772767], + [125.24354, -20.801103], + [125.275212, -20.830179], + [125.306113, -20.859977], + [125.336223, -20.89048], + [125.365524, -20.921668], + [125.393996, -20.953523], + [125.421623, -20.986025], + [125.448387, -21.019156], + [125.474271, -21.052893], + [125.499259, -21.087218], + [125.523336, -21.122109], + [125.546485, -21.157546], + [125.568692, -21.193505], + [125.589943, -21.229966], + [125.610224, -21.266907], + [125.629523, -21.304304], + [125.647826, -21.342135], + [125.665122, -21.380377], + [125.681399, -21.419006], + [125.696646, -21.457999], + [125.710855, -21.497332], + [125.724014, -21.536981], + [125.736115, -21.576922], + [125.74715, -21.617129], + [125.757111, -21.657579], + [125.76599, -21.698246], + [125.773783, -21.739105], + [125.780482, -21.780132], + [125.786084, -21.8213], + [125.790582, -21.862586], + [125.793975, -21.903962], + [125.796258, -21.945403], + [125.797429, -21.986885], [125.797488, -22.028381], [124, -22] ] @@ -55,53 +102,69 @@ [ [124, -22], [126.696439, -22.035218], - [126.682054, -22.280117], - [126.641725, -22.522527], - [126.57571, -22.760099], - [126.484516, -22.990519], - [126.368908, -23.211528], - [126.229905, -23.420951], - [126.068769, -23.616713], - [125.887005, -23.796867], - [125.686343, -23.95961], - [125.468726, -24.10331], - [125.236289, -24.226515], - [124.991339, -24.327981], - [124.73633, -24.406676], - [124.473834, -24.4618], - [124.206514, -24.49279], - [123.937089, -24.499332], - [123.668306, -24.481357], - [123.402902, -24.439049], - [123.143573, -24.372841], - [122.892945, -24.283405], - [122.653537, -24.171653], - [122.427739, -24.038715], - [122.21778, -23.885936], - [122.025708, -23.714854], - [121.853369, -23.527183], - [121.702389, -23.324795], - [121.574161, -23.1097], - [121.469836, -22.884023], - [121.390312, -22.64998], - [121.336236, -22.40986], - [121.307999, -22.165995], - [121.305736, -21.920743], - [121.329335, -21.676463], - [121.378441, -21.435492], - [121.452461, -21.200124], - [121.550581, -20.972591], - [121.671769, -20.755038], - [121.814793, -20.549511], - [121.978233, -20.357933], - [122.160497, -20.182091], - [122.359832, -20.023623], - [122.574347, -19.883997], - [122.802024, -19.764507], - [123.040738, -19.666255], - [123.288275, -19.590147], - [123.54235, -19.536886], - [123.800626, -19.50696], + [126.688162, -22.218141], + [126.665416, -22.400012], + [126.628265, -22.579849], + [126.576855, -22.75668], + [126.511409, -22.929545], + [126.43223, -23.097499], + [126.339701, -23.259623], + [126.234279, -23.415026], + [126.116502, -23.56285], + [125.986979, -23.702275], + [125.846392, -23.832527], + [125.695492, -23.952877], + [125.535093, -24.062653], + [125.366071, -24.161238], + [125.189356, -24.248076], + [125.005929, -24.322678], + [124.816814, -24.384621], + [124.623073, -24.433554], + [124.4258, -24.4692], + [124.22611, -24.491355], + [124.025137, -24.499893], + [123.82402, -24.494767], + [123.623903, -24.476005], + [123.425921, -24.443714], + [123.231195, -24.398077], + [123.040823, -24.339354], + [122.855878, -24.267878], + [122.677392, -24.184053], + [122.506359, -24.088353], + [122.343722, -23.981317], + [122.19037, -23.863547], + [122.047134, -23.735703], + [121.91478, -23.598499], + [121.794008, -23.452698], + [121.685447, -23.29911], + [121.589651, -23.138582], + [121.507098, -22.971999], + [121.43819, -22.800274], + [121.383249, -22.624344], + [121.34252, -22.445167], + [121.316165, -22.263713], + [121.304272, -22.080961], + [121.306846, -21.897892], + [121.323819, -21.715488], + [121.355046, -21.53472], + [121.400308, -21.356549], + [121.459317, -21.181918], + [121.531712, -21.011749], + [121.617071, -20.846936], + [121.714905, -20.688343], + [121.824667, -20.5368], + [121.94575, -20.393097], + [122.077498, -20.25798], + [122.2192, -20.132151], + [122.370104, -20.016261], + [122.529412, -19.910908], + [122.696289, -19.816638], + [122.869865, -19.733934], + [123.049239, -19.663222], + [123.233486, -19.604865], + [123.421658, -19.559163], + [123.612788, -19.526351], + [123.805898, -19.506596], [124, -19.5], [124, -22] ] diff --git a/packages/turf-angle/test/out/acute-inverse.json b/packages/turf-angle/test/out/acute-inverse.json index 1552672d8c..e92c2c4b96 100644 --- a/packages/turf-angle/test/out/acute-inverse.json +++ b/packages/turf-angle/test/out/acute-inverse.json @@ -17,15 +17,69 @@ [ [51.5, 12], [50.487833, 9.836074], - [50.277234, 9.943461], - [50.078172, 10.070529], - [49.892538, 10.216077], - [49.722103, 10.378729], - [49.5685, 10.556944], - [49.433213, 10.749034], - [49.317557, 10.953174], - [49.22267, 11.167425], - [49.1495, 11.389745], + [50.455818, 9.850776], + [50.424022, 9.865934], + [50.392451, 9.881546], + [50.361111, 9.897607], + [50.33001, 9.914115], + [50.299154, 9.931065], + [50.268549, 9.948455], + [50.238202, 9.966281], + [50.20812, 9.984538], + [50.178308, 10.003224], + [50.148772, 10.022334], + [50.11952, 10.041864], + [50.090557, 10.06181], + [50.06189, 10.082168], + [50.033523, 10.102934], + [50.005465, 10.124103], + [49.977719, 10.145671], + [49.950293, 10.167633], + [49.923192, 10.189986], + [49.896422, 10.212723], + [49.869988, 10.23584], + [49.843896, 10.259333], + [49.818152, 10.283196], + [49.792761, 10.307425], + [49.767728, 10.332014], + [49.743059, 10.356958], + [49.718759, 10.382253], + [49.694834, 10.407892], + [49.671288, 10.43387], + [49.648126, 10.460182], + [49.625353, 10.486822], + [49.602975, 10.513785], + [49.580996, 10.541065], + [49.559421, 10.568656], + [49.538254, 10.596553], + [49.5175, 10.624749], + [49.497163, 10.653239], + [49.477248, 10.682016], + [49.45776, 10.711075], + [49.438701, 10.740409], + [49.420077, 10.770013], + [49.401892, 10.79988], + [49.384149, 10.830003], + [49.366852, 10.860377], + [49.350005, 10.890995], + [49.333613, 10.92185], + [49.317677, 10.952936], + [49.302203, 10.984247], + [49.287192, 11.015775], + [49.27265, 11.047515], + [49.258578, 11.079459], + [49.24498, 11.1116], + [49.231858, 11.143933], + [49.219217, 11.17645], + [49.207059, 11.209144], + [49.195385, 11.242008], + [49.1842, 11.275035], + [49.173506, 11.308219], + [49.163304, 11.341552], + [49.153598, 11.375027], + [49.144389, 11.408638], + [49.13568, 11.442376], + [49.127473, 11.476235], [49.119769, 11.510208], [51.5, 12] ] @@ -48,60 +102,69 @@ [ [51.5, 12], [47.932822, 11.25803], - [47.873567, 11.603477], - [47.848992, 11.952945], - [47.859463, 12.303091], - [47.905017, 12.650551], - [47.985359, 12.991975], - [48.099856, 13.324054], - [48.247537, 13.643558], - [48.4271, 13.947363], - [48.636914, 14.232484], - [48.875029, 14.496108], - [49.139195, 14.735622], - [49.426877, 14.948639], - [49.735278, 15.133032], - [50.06137, 15.286948], - [50.401919, 15.40884], - [50.753526, 15.497476], - [51.112662, 15.551961], - [51.475707, 15.571742], - [51.838997, 15.556618], - [52.198865, 15.506745], - [52.551684, 15.422625], - [52.893911, 15.305111], - [53.222124, 15.155389], - [53.533069, 14.974966], - [53.823685, 14.765654], - [54.091144, 14.529547], - [54.332875, 14.268996], - [54.546588, 13.986587], - [54.730293, 13.685109], - [54.882315, 13.367523], - [55.001308, 13.036939], - [55.086255, 12.696573], - [55.13648, 12.349726], - [55.151641, 11.999745], - [55.131733, 11.649992], - [55.077077, 11.303816], - [54.988318, 10.964519], - [54.866411, 10.635327], - [54.712609, 10.319362], - [54.528451, 10.019612], - [54.315747, 9.738906], - [54.076559, 9.479888], - [53.813179, 9.244997], - [53.528116, 9.036438], - [53.224067, 8.85617], - [52.903896, 8.705883], - [52.570607, 8.586988], - [52.227323, 8.500597], - [51.87725, 8.447521], - [51.523657, 8.428256], - [51.169844, 8.442984], - [50.819111, 8.491566], - [50.474732, 8.573548], - [50.139926, 8.68816], + [47.880206, 11.551701], + [47.852657, 11.848643], + [47.850444, 12.1468], + [47.873667, 12.4441], + [47.922251, 12.738471], + [47.995945, 13.027852], + [48.094321, 13.310212], + [48.216776, 13.583558], + [48.362528, 13.845956], + [48.530626, 14.095541], + [48.719947, 14.330532], + [48.929209, 14.549244], + [49.156971, 14.750105], + [49.401646, 14.931665], + [49.661512, 15.092608], + [49.934722, 15.231766], + [50.21932, 15.348124], + [50.513252, 15.440832], + [50.814387, 15.509212], + [51.120533, 15.552762], + [51.429455, 15.571163], + [51.738892, 15.564279], + [52.046582, 15.532161], + [52.350276, 15.475046], + [52.647759, 15.393351], + [52.93687, 15.287676], + [53.215519, 15.158792], + [53.481702, 15.007641], + [53.733522, 14.835322], + [53.969197, 14.643085], + [54.187077, 14.43232], + [54.385654, 14.204546], + [54.563573, 13.961397], + [54.719638, 13.704611], + [54.852817, 13.436018], + [54.962251, 13.157522], + [55.047257, 12.871091], + [55.107326, 12.57874], + [55.142126, 12.282518], + [55.151503, 11.984494], + [55.135477, 11.686742], + [55.094241, 11.391327], + [55.028156, 11.100292], + [54.93775, 10.815644], + [54.823708, 10.539341], + [54.68687, 10.27328], + [54.528225, 10.019281], + [54.3489, 9.779083], + [54.150154, 9.554324], + [53.933373, 9.346538], + [53.700055, 9.157138], + [53.451804, 8.987415], + [53.190318, 8.838522], + [52.917382, 8.71147], + [52.634852, 8.607124], + [52.344643, 8.526191], + [52.048723, 8.46922], + [51.749093, 8.4366], + [51.447779, 8.42855], + [51.146818, 8.445126], + [50.848244, 8.486215], + [50.554078, 8.551539], + [50.266308, 8.640653], [49.986887, 8.752953], [51.5, 12] ] diff --git a/packages/turf-angle/test/out/acute.json b/packages/turf-angle/test/out/acute.json index ee6a8a5660..a71ae6582f 100644 --- a/packages/turf-angle/test/out/acute.json +++ b/packages/turf-angle/test/out/acute.json @@ -17,60 +17,69 @@ [ [51.5, 12], [49.15854, 11.518357], - [49.120638, 11.745143], - [49.10556, 11.974473], - [49.113507, 12.204146], - [49.144464, 12.431952], - [49.19819, 12.655692], - [49.274228, 12.873202], - [49.371897, 13.082371], - [49.490303, 13.281165], - [49.628345, 13.467643], - [49.784718, 13.639982], - [49.957931, 13.79649], - [50.146315, 13.935628], - [50.348045, 14.056025], - [50.561151, 14.156492], - [50.783542, 14.236033], - [51.013027, 14.293862], - [51.247338, 14.329405], - [51.484154, 14.342308], - [51.721127, 14.332443], - [51.955908, 14.299909], - [52.18617, 14.245028], - [52.409637, 14.168345], - [52.624106, 14.07062], - [52.827472, 13.95282], - [53.017749, 13.81611], - [53.193088, 13.661836], - [53.3518, 13.491517], - [53.49237, 13.306824], - [53.613467, 13.109566], - [53.713962, 12.901666], - [53.792933, 12.685149], - [53.849671, 12.462117], - [53.883687, 12.234728], - [53.894713, 12.005176], - [53.882703, 11.775673], - [53.84783, 11.548421], - [53.790482, 11.325597], - [53.711258, 11.10933], - [53.610958, 10.901685], - [53.490579, 10.704637], - [53.351299, 10.520059], - [53.194469, 10.349702], - [53.0216, 10.195182], - [52.834345, 10.057961], - [52.634489, 9.939336], - [52.423929, 9.84043], - [52.204659, 9.762175], - [51.978749, 9.70531], - [51.74833, 9.670372], - [51.515573, 9.657691], - [51.282669, 9.667386], - [51.051812, 9.699366], - [50.825175, 9.753328], - [50.604897, 9.828765], + [49.124843, 11.711158], + [49.107647, 11.906037], + [49.107107, 12.101642], + [49.123262, 12.296609], + [49.156037, 12.489577], + [49.205239, 12.679197], + [49.27056, 12.864137], + [49.351579, 13.043099], + [49.447757, 13.214821], + [49.55845, 13.37809], + [49.682904, 13.531749], + [49.820264, 13.674709], + [49.969578, 13.805952], + [50.129802, 13.924543], + [50.299812, 14.029634], + [50.478406, 14.120476], + [50.664316, 14.196415], + [50.856218, 14.256907], + [51.052739, 14.301518], + [51.252473, 14.329928], + [51.453985, 14.34193], + [51.655827, 14.33744], + [51.85655, 14.31649], + [52.054711, 14.279229], + [52.248891, 14.225927], + [52.437699, 14.156966], + [52.619788, 14.072842], + [52.793863, 13.974157], + [52.958691, 13.861619], + [53.113112, 13.736031], + [53.256043, 13.598289], + [53.38649, 13.449375], + [53.503554, 13.290346], + [53.606434, 13.122329], + [53.694435, 12.946513], + [53.766969, 12.764138], + [53.823562, 12.576487], + [53.863854, 12.384879], + [53.887599, 12.190654], + [53.894669, 11.995171], + [53.885052, 11.799792], + [53.858849, 11.605877], + [53.816276, 11.414772], + [53.757661, 11.227801], + [53.683439, 11.046258], + [53.594149, 10.871395], + [53.490431, 10.704419], + [53.373021, 10.54648], + [53.242743, 10.398663], + [53.100509, 10.261983], + [52.947306, 10.137378], + [52.784194, 10.025703], + [52.612299, 9.927722], + [52.4328, 9.844107], + [52.246931, 9.775428], + [52.055961, 9.722157], + [51.861198, 9.684656], + [51.66397, 9.663183], + [51.465624, 9.657885], + [51.267512, 9.668796], + [51.070987, 9.695843], + [50.877388, 9.738842], + [50.688039, 9.797497], [50.504234, 9.871408], [51.5, 12] ] @@ -93,15 +102,69 @@ [ [51.5, 12], [50.011338, 8.805989], - [49.701359, 8.963929], - [49.408212, 9.150836], - [49.134662, 9.364957], - [48.883305, 9.60428], - [48.656539, 9.866554], - [48.456547, 10.14931], - [48.285274, 10.449882], - [48.144412, 10.76543], - [48.035382, 11.092966], + [49.964224, 8.827611], + [49.917429, 8.849905], + [49.870962, 8.872865], + [49.824834, 8.896487], + [49.779053, 8.920766], + [49.733629, 8.945697], + [49.688572, 8.971274], + [49.643892, 8.997493], + [49.599597, 9.024348], + [49.555696, 9.051832], + [49.5122, 9.079942], + [49.469117, 9.10867], + [49.426456, 9.138011], + [49.384226, 9.167958], + [49.342435, 9.198506], + [49.301094, 9.229647], + [49.26021, 9.261376], + [49.219792, 9.293686], + [49.179848, 9.32657], + [49.140388, 9.360022], + [49.101419, 9.394034], + [49.062949, 9.428599], + [49.024986, 9.46371], + [48.98754, 9.499359], + [48.950617, 9.53554], + [48.914225, 9.572245], + [48.878372, 9.609465], + [48.843067, 9.647194], + [48.808315, 9.685423], + [48.774125, 9.724145], + [48.740504, 9.763351], + [48.707459, 9.803033], + [48.674998, 9.843183], + [48.643126, 9.883792], + [48.611852, 9.924852], + [48.581181, 9.966355], + [48.551121, 10.008291], + [48.521677, 10.050652], + [48.492857, 10.093429], + [48.464666, 10.136613], + [48.437111, 10.180196], + [48.410197, 10.224167], + [48.38393, 10.268518], + [48.358317, 10.313239], + [48.333362, 10.358321], + [48.309072, 10.403755], + [48.285451, 10.449531], + [48.262506, 10.495639], + [48.24024, 10.54207], + [48.218658, 10.588814], + [48.197767, 10.635862], + [48.17757, 10.683202], + [48.158072, 10.730826], + [48.139277, 10.778723], + [48.121189, 10.826884], + [48.103814, 10.875298], + [48.087154, 10.923954], + [48.071213, 10.972843], + [48.055996, 11.021955], + [48.041505, 11.071279], + [48.027744, 11.120804], + [48.014717, 11.17052], + [48.002426, 11.220418], [47.990875, 11.270485], [51.5, 12] ] diff --git a/packages/turf-angle/test/out/obtuse-bigger.json b/packages/turf-angle/test/out/obtuse-bigger.json index bc0960f07e..63f0216685 100644 --- a/packages/turf-angle/test/out/obtuse-bigger.json +++ b/packages/turf-angle/test/out/obtuse-bigger.json @@ -17,27 +17,69 @@ [ [51.5, 12], [50.487833, 9.836074], - [50.277234, 9.943461], - [50.078172, 10.070529], - [49.892538, 10.216077], - [49.722103, 10.378729], - [49.5685, 10.556944], - [49.433213, 10.749034], - [49.317557, 10.953174], - [49.22267, 11.167425], - [49.1495, 11.389745], - [49.098792, 11.618014], - [49.071086, 11.850048], - [49.066705, 12.083622], - [49.08575, 12.316494], - [49.128101, 12.546418], - [49.193411, 12.771173], - [49.281108, 12.988582], - [49.390402, 13.196533], - [49.520282, 13.392999], - [49.669531, 13.57606], - [49.836735, 13.743922], - [50.020291, 13.894936], + [50.415688, 9.870001], + [50.344705, 9.906244], + [50.274961, 9.944764], + [50.20653, 9.985519], + [50.139487, 10.028467], + [50.073904, 10.07356], + [50.009852, 10.120751], + [49.9474, 10.169988], + [49.886617, 10.221219], + [49.827567, 10.274389], + [49.770315, 10.32944], + [49.714924, 10.386313], + [49.661454, 10.444947], + [49.609964, 10.505278], + [49.56051, 10.567243], + [49.513147, 10.630774], + [49.467926, 10.695802], + [49.424898, 10.762257], + [49.384111, 10.830068], + [49.34561, 10.899161], + [49.309438, 10.969462], + [49.275636, 11.040894], + [49.244242, 11.113381], + [49.215292, 11.186844], + [49.188819, 11.261202], + [49.164853, 11.336377], + [49.143422, 11.412286], + [49.124552, 11.488846], + [49.108264, 11.565975], + [49.09458, 11.643588], + [49.083515, 11.721602], + [49.075084, 11.79993], + [49.069299, 11.878489], + [49.066168, 11.957192], + [49.065696, 12.035953], + [49.067887, 12.114687], + [49.072741, 12.193306], + [49.080254, 12.271725], + [49.090421, 12.349859], + [49.103233, 12.427621], + [49.118679, 12.504926], + [49.136743, 12.58169], + [49.157408, 12.657827], + [49.180655, 12.733254], + [49.206459, 12.807888], + [49.234795, 12.881646], + [49.265633, 12.954447], + [49.298942, 13.026211], + [49.334688, 13.096859], + [49.372832, 13.166311], + [49.413335, 13.234492], + [49.456154, 13.301325], + [49.501244, 13.366736], + [49.548555, 13.430652], + [49.598038, 13.493003], + [49.64964, 13.553719], + [49.703304, 13.612733], + [49.758972, 13.669977], + [49.816583, 13.72539], + [49.876076, 13.778908], + [49.937384, 13.830471], + [50.000441, 13.880023], + [50.065177, 13.927507], [50.131521, 13.972871], [51.5, 12] ] @@ -60,48 +102,69 @@ [ [51.5, 12], [49.438664, 14.956465], - [49.747822, 15.139689], - [50.074546, 15.29237], - [50.415597, 15.412972], - [50.767569, 15.500276], - [51.126927, 15.5534], - [51.490051, 15.571806], - [51.853276, 15.555308], - [52.212935, 15.504072], - [52.565402, 15.418617], - [52.90714, 15.299808], - [53.234733, 15.148845], - [53.544933, 14.967247], - [53.834688, 14.756837], - [54.101179, 14.51972], - [54.341847, 14.258257], - [54.554412, 13.975042], - [54.736897, 13.672871], - [54.887641, 13.354713], - [55.005307, 13.023681], - [55.088896, 12.682997], - [55.137743, 12.335963], - [55.151519, 11.985927], - [55.130232, 11.636252], - [55.074218, 11.290285], - [54.984132, 10.951326], - [54.860941, 10.622597], - [54.705911, 10.307216], - [54.520592, 10.008164], - [54.306803, 9.728265], - [54.066616, 9.470154], - [53.802332, 9.236261], - [53.516469, 9.028782], - [53.211729, 8.849666], - [52.890982, 8.700592], - [52.55724, 8.582959], - [52.213626, 8.497869], - [51.863352, 8.446119], - [51.509688, 8.428193], - [51.155934, 8.444261], - [50.80539, 8.494171], - [50.461328, 8.577455], - [50.126964, 8.693334], + [49.641509, 15.081264], + [49.85254, 15.192891], + [50.07084, 15.290851], + [50.295457, 15.374712], + [50.525406, 15.4441], + [50.759673, 15.498708], + [50.997223, 15.538293], + [51.237005, 15.562678], + [51.477954, 15.571755], + [51.719002, 15.565483], + [51.959077, 15.543891], + [52.197114, 15.507073], + [52.432059, 15.455195], + [52.662874, 15.388488], + [52.88854, 15.307247], + [53.108067, 15.211834], + [53.320497, 15.10267], + [53.524905, 14.98024], + [53.720408, 14.845083], + [53.906169, 14.697794], + [54.081395, 14.539021], + [54.245349, 14.369457], + [54.397344, 14.189844], + [54.536752, 14.000964], + [54.663004, 13.803636], + [54.775592, 13.598714], + [54.874069, 13.387083], + [54.958053, 13.169651], + [55.027225, 12.947351], + [55.081334, 12.721134], + [55.12019, 12.491961], + [55.143671, 12.260809], + [55.15172, 12.028654], + [55.144342, 11.796478], + [55.121608, 11.565259], + [55.083651, 11.33597], + [55.030665, 11.10957], + [54.962907, 10.887009], + [54.880689, 10.669215], + [54.784382, 10.457096], + [54.674414, 10.251534], + [54.551265, 10.053385], + [54.415465, 9.86347], + [54.267596, 9.682576], + [54.108285, 9.511453], + [53.938204, 9.350808], + [53.758066, 9.201305], + [53.568623, 9.063562], + [53.370664, 8.938146], + [53.165008, 8.825577], + [52.952508, 8.726317], + [52.73404, 8.640776], + [52.510503, 8.569307], + [52.282818, 8.512204], + [52.051921, 8.469703], + [51.818759, 8.441978], + [51.584289, 8.429144], + [51.349473, 8.431253], + [51.115275, 8.448297], + [50.882655, 8.480206], + [50.652569, 8.526848], + [50.42596, 8.588031], + [50.203762, 8.663503], [49.986887, 8.752953], [51.5, 12] ] diff --git a/packages/turf-angle/test/out/obtuse.json b/packages/turf-angle/test/out/obtuse.json index 99ef8ce227..5c2a544c57 100644 --- a/packages/turf-angle/test/out/obtuse.json +++ b/packages/turf-angle/test/out/obtuse.json @@ -17,44 +17,69 @@ [ [51.5, 12], [50.487833, 9.836074], - [50.277234, 9.943461], - [50.078172, 10.070529], - [49.892538, 10.216077], - [49.722103, 10.378729], - [49.5685, 10.556944], - [49.433213, 10.749034], - [49.317557, 10.953174], - [49.22267, 11.167425], - [49.1495, 11.389745], - [49.098792, 11.618014], - [49.071086, 11.850048], - [49.066705, 12.083622], - [49.08575, 12.316494], - [49.128101, 12.546418], - [49.193411, 12.771173], - [49.281108, 12.988582], - [49.390402, 13.196533], - [49.520282, 13.392999], - [49.669531, 13.57606], - [49.836735, 13.743922], - [50.020291, 13.894936], - [50.218425, 14.027614], - [50.429209, 14.140647], - [50.650581, 14.232917], - [50.880362, 14.30351], - [51.116285, 14.351725], - [51.356013, 14.377083], - [51.59717, 14.379333], - [51.837362, 14.358452], - [52.074209, 14.314647], - [52.305363, 14.248355], - [52.528542, 14.160231], - [52.741549, 14.051151], - [52.942296, 13.922192], - [53.128828, 13.77463], - [53.29934, 13.609917], - [53.452195, 13.429673], - [53.58594, 13.235665], + [50.358618, 9.898909], + [50.233379, 9.969168], + [50.112553, 10.046605], + [49.996566, 10.130951], + [49.885824, 10.22191], + [49.780719, 10.319164], + [49.681622, 10.422375], + [49.588884, 10.53118], + [49.502838, 10.6452], + [49.42379, 10.764034], + [49.352026, 10.887265], + [49.287806, 11.014462], + [49.231365, 11.145177], + [49.18291, 11.278951], + [49.142624, 11.415312], + [49.11066, 11.553779], + [49.087142, 11.693864], + [49.072167, 11.835071], + [49.0658, 11.976901], + [49.068078, 12.11885], + [49.079005, 12.260414], + [49.098557, 12.401089], + [49.126679, 12.540375], + [49.163284, 12.677773], + [49.208255, 12.812793], + [49.261445, 12.944952], + [49.322676, 13.073774], + [49.391742, 13.198797], + [49.468406, 13.31957], + [49.552404, 13.435659], + [49.643443, 13.546643], + [49.741204, 13.65212], + [49.845343, 13.751709], + [49.95549, 13.845048], + [50.071254, 13.931797], + [50.192218, 14.011641], + [50.317949, 14.084288], + [50.447992, 14.149474], + [50.581878, 14.206959], + [50.719119, 14.256534], + [50.859217, 14.298017], + [51.001659, 14.331256], + [51.145927, 14.356129], + [51.291492, 14.372545], + [51.43782, 14.380443], + [51.584377, 14.379796], + [51.730624, 14.370604], + [51.876026, 14.352902], + [52.020051, 14.326755], + [52.162172, 14.292258], + [52.301869, 14.249539], + [52.438634, 14.198753], + [52.571968, 14.140087], + [52.701388, 14.073756], + [52.826426, 14], + [52.94663, 13.919091], + [53.061568, 13.831323], + [53.17083, 13.737014], + [53.274026, 13.636509], + [53.37079, 13.530172], + [53.460782, 13.418389], + [53.543687, 13.301563], + [53.619216, 13.180118], [53.68711, 13.05449], [51.5, 12] ] @@ -77,31 +102,69 @@ [ [51.5, 12], [54.787546, 13.574894], - [54.928068, 13.252368], - [55.035164, 12.917965], - [55.107937, 12.574936], - [55.145829, 12.226602], - [55.148618, 11.876317], - [55.116414, 11.527444], - [55.049653, 11.183318], - [54.94909, 10.847218], - [54.815787, 10.522337], - [54.6511, 10.211751], - [54.456665, 9.918397], - [54.234382, 9.645041], - [53.986397, 9.394258], - [53.715082, 9.168405], - [53.423013, 8.969603], - [53.112949, 8.79972], - [52.787806, 8.660347], - [52.450635, 8.552793], - [52.104588, 8.478063], - [51.7529, 8.436859], - [51.398853, 8.429567], - [51.045749, 8.456255], - [50.696883, 8.516673], - [50.355514, 8.610255], - [50.024832, 8.736124], + [54.846609, 13.449936], + [54.900628, 13.32285], + [54.949533, 13.193828], + [54.993256, 13.063064], + [55.031743, 12.930753], + [55.064944, 12.797093], + [55.092818, 12.662285], + [55.115333, 12.526529], + [55.132464, 12.390028], + [55.144195, 12.252984], + [55.150515, 12.1156], + [55.151426, 11.97808], + [55.146932, 11.840628], + [55.13705, 11.703446], + [55.121802, 11.566736], + [55.101218, 11.430701], + [55.075335, 11.29554], + [55.044199, 11.161451], + [55.007863, 11.028631], + [54.966386, 10.897275], + [54.919835, 10.767575], + [54.868285, 10.639721], + [54.811817, 10.513899], + [54.750517, 10.390292], + [54.684482, 10.269082], + [54.61381, 10.150444], + [54.538611, 10.034551], + [54.458997, 9.921571], + [54.375087, 9.81167], + [54.287007, 9.705005], + [54.194889, 9.601733], + [54.098867, 9.502002], + [53.999084, 9.405957], + [53.895687, 9.313739], + [53.788828, 9.225479], + [53.678662, 9.141306], + [53.565351, 9.061341], + [53.449059, 8.985701], + [53.329956, 8.914495], + [53.208215, 8.847825], + [53.084012, 8.785788], + [52.957528, 8.728474], + [52.828944, 8.675965], + [52.698447, 8.628338], + [52.566224, 8.585661], + [52.432468, 8.547995], + [52.29737, 8.515396], + [52.161125, 8.48791], + [52.023929, 8.465577], + [51.88598, 8.448429], + [51.747475, 8.436491], + [51.608615, 8.42978], + [51.469598, 8.428306], + [51.330626, 8.432071], + [51.191897, 8.441069], + [51.05361, 8.455288], + [50.915966, 8.474707], + [50.779162, 8.499299], + [50.643394, 8.529026], + [50.508859, 8.563847], + [50.37575, 8.603712], + [50.244259, 8.648562], + [50.114576, 8.698333], [49.986887, 8.752953], [51.5, 12] ] diff --git a/packages/turf-line-arc/index.ts b/packages/turf-line-arc/index.ts index 359c8a4f41..1cb9d9e824 100644 --- a/packages/turf-line-arc/index.ts +++ b/packages/turf-line-arc/index.ts @@ -13,7 +13,7 @@ import { Coord, lineString, Units } from "@turf/helpers"; * @param {number} bearing1 angle, in decimal degrees, of the first radius of the arc * @param {number} bearing2 angle, in decimal degrees, of the second radius of the arc * @param {Object} [options={}] Optional parameters - * @param {number} [options.steps=64] number of steps + * @param {number} [options.steps=64] number of steps (straight segments) that will constitute the arc * @param {string} [options.units='kilometers'] miles, kilometers, degrees, or radians * @returns {Feature} line arc * @example @@ -57,21 +57,19 @@ export default function lineArc( const arcStartDegree = angle1; const arcEndDegree = angle1 < angle2 ? angle2 : angle2 + 360; - let alfa = arcStartDegree; + let alpha = arcStartDegree; const coordinates = []; let i = 0; - - while (alfa < arcEndDegree) { + // How many degrees we'll swing around between each step. + const arcStep = (arcEndDegree - arcStartDegree) / steps; + // Add coords to the list, increasing the angle from our start bearing + // (alpha) by arcStep degrees until we reach the end bearing. + while (alpha <= arcEndDegree) { coordinates.push( - destination(center, radius, alfa, options).geometry.coordinates + destination(center, radius, alpha, options).geometry.coordinates ); i++; - alfa = arcStartDegree + (i * 360) / steps; - } - if (alfa >= arcEndDegree) { - coordinates.push( - destination(center, radius, arcEndDegree, options).geometry.coordinates - ); + alpha = arcStartDegree + i * arcStep; } return lineString(coordinates, properties); } @@ -81,11 +79,11 @@ export default function lineArc( * and returns a valid angle between 0-360 degrees * * @private - * @param {number} alfa angle between -180-180 degrees + * @param {number} alpha angle between -180-180 degrees * @returns {number} angle between 0-360 degrees */ -function convertAngleTo360(alfa: number) { - let beta = alfa % 360; +function convertAngleTo360(alpha: number) { + let beta = alpha % 360; if (beta < 0) { beta += 360; } diff --git a/packages/turf-line-arc/test.js b/packages/turf-line-arc/test.js index b2150d3093..85cb507b8a 100644 --- a/packages/turf-line-arc/test.js +++ b/packages/turf-line-arc/test.js @@ -4,7 +4,7 @@ const path = require("path"); const load = require("load-json-file"); const write = require("write-json-file"); const truncate = require("@turf/truncate").default; -const { featureCollection } = require("@turf/helpers"); +const { featureCollection, point } = require("@turf/helpers"); const lineArc = require("./index").default; const directories = { @@ -24,12 +24,54 @@ test("turf-line-arc", (t) => { for (const { filename, name, geojson } of fixtures) { const { radius, bearing1, bearing2, steps, units } = geojson.properties; const arc = truncate( - lineArc(geojson, radius, bearing1, bearing2, steps, units) + lineArc(geojson, radius, bearing1, bearing2, { steps, units }) ); const results = featureCollection([geojson, arc]); - if (process.env.REGEN) write.sync(directories.out + filename, results); t.deepEquals(results, load.sync(directories.out + filename), name); + // Check the resulting arc geometry has the expected number of points. + // undefined or 0 steps should default to 64 + 1 points, 1 to 1 + 1, + // 2 to 2 + 1, ... + const expectedPoints = geojson.properties?.steps + ? geojson.properties?.steps + 1 + : 64 + 1; + t.equals( + arc.geometry.coordinates.length, + expectedPoints, + `${name} number of points in arc` + ); } t.end(); }); + +test("turf-line-arc #2524", (t) => { + // Just test to make sure we're getting the correct number of points in the + // resultant arc i.e. steps + 1 + const options = { steps: 10, units: "kilometers" }; + + const center = point([115.959444, -31.945]); + const startAngle = 223; + const endAngle = 277; + const radius = 130; + const arc = lineArc(center, radius, startAngle, endAngle, options); + + t.equals(arc.geometry.coordinates.length, 10 + 1, "Number of points in arc"); + t.end(); +}); + +test("turf-line-arc #2446", (t) => { + // Test to make sure we're not getting an error, as described in + // https://github.com/Turfjs/turf/issues/2446 + const options = { steps: 15, units: "kilometers" }; + + const center = point([115.959444, -31.945]); + const startAngle = 253; + const endAngle = 277; + const radius = 119.7195; + + t.doesNotThrow(() => + lineArc(center, radius * 1.852, startAngle, endAngle, options) + ); + + t.end(); +}); diff --git a/packages/turf-line-arc/test/in/line-arc-one-step.geojson b/packages/turf-line-arc/test/in/line-arc-one-step.geojson new file mode 100644 index 0000000000..e309c37ed9 --- /dev/null +++ b/packages/turf-line-arc/test/in/line-arc-one-step.geojson @@ -0,0 +1,13 @@ +{ + "type": "Feature", + "properties": { + "steps": 1, + "radius": 500, + "bearing1": 60, + "bearing2": 65 + }, + "geometry": { + "type": "Point", + "coordinates": [11.343, 44.495] + } +} diff --git a/packages/turf-line-arc/test/in/line-arc-zero-steps.geojson b/packages/turf-line-arc/test/in/line-arc-zero-steps.geojson new file mode 100644 index 0000000000..4d7ec246e0 --- /dev/null +++ b/packages/turf-line-arc/test/in/line-arc-zero-steps.geojson @@ -0,0 +1,13 @@ +{ + "type": "Feature", + "properties": { + "steps": 0, + "radius": 500, + "bearing1": 60, + "bearing2": 65 + }, + "geometry": { + "type": "Point", + "coordinates": [11.343, 44.495] + } +} diff --git a/packages/turf-line-arc/test/in/line-arc7.geojson b/packages/turf-line-arc/test/in/line-arc7.geojson new file mode 100644 index 0000000000..bf64b88470 --- /dev/null +++ b/packages/turf-line-arc/test/in/line-arc7.geojson @@ -0,0 +1,12 @@ +{ + "type": "Feature", + "properties": { + "radius": 500, + "bearing1": 60, + "bearing2": 65 + }, + "geometry": { + "type": "Point", + "coordinates": [11.343, 44.495] + } +} diff --git a/packages/turf-line-arc/test/out/line-arc-greater-360.geojson b/packages/turf-line-arc/test/out/line-arc-greater-360.geojson index 3c73025420..a22155c6ac 100644 --- a/packages/turf-line-arc/test/out/line-arc-greater-360.geojson +++ b/packages/turf-line-arc/test/out/line-arc-greater-360.geojson @@ -24,9 +24,69 @@ "type": "LineString", "coordinates": [ [11.343, 44.539966], + [11.343344, 44.539965], + [11.343688, 44.539963], + [11.344032, 44.53996], + [11.344376, 44.539955], + [11.34472, 44.539949], + [11.345064, 44.539942], + [11.345408, 44.539933], + [11.345752, 44.539923], + [11.346096, 44.539912], + [11.346439, 44.539899], + [11.346783, 44.539885], + [11.347126, 44.53987], + [11.347469, 44.539853], + [11.347813, 44.539835], + [11.348156, 44.539816], + [11.348498, 44.539795], + [11.348841, 44.539773], [11.349184, 44.539749], + [11.349526, 44.539725], + [11.349868, 44.539699], + [11.35021, 44.539671], + [11.350552, 44.539642], + [11.350893, 44.539612], + [11.351234, 44.539581], + [11.351575, 44.539548], + [11.351916, 44.539514], + [11.352257, 44.539479], + [11.352597, 44.539442], + [11.352937, 44.539404], + [11.353276, 44.539365], + [11.353616, 44.539324], + [11.353955, 44.539282], + [11.354294, 44.539239], + [11.354632, 44.539194], + [11.35497, 44.539149], [11.355307, 44.539101], + [11.355645, 44.539053], + [11.355982, 44.539003], + [11.356318, 44.538952], + [11.356654, 44.538899], + [11.35699, 44.538846], + [11.357325, 44.53879], + [11.35766, 44.538734], + [11.357995, 44.538676], + [11.358329, 44.538617], + [11.358662, 44.538557], + [11.358995, 44.538496], + [11.359328, 44.538433], + [11.35966, 44.538369], + [11.359991, 44.538303], + [11.360322, 44.538236], + [11.360653, 44.538168], + [11.360983, 44.538099], [11.361313, 44.538028], + [11.361642, 44.537956], + [11.36197, 44.537883], + [11.362298, 44.537809], + [11.362625, 44.537733], + [11.362952, 44.537656], + [11.363278, 44.537578], + [11.363603, 44.537498], + [11.363928, 44.537418], + [11.364252, 44.537336], [11.364576, 44.537252] ] } diff --git a/packages/turf-line-arc/test/out/line-arc-one-step.geojson b/packages/turf-line-arc/test/out/line-arc-one-step.geojson new file mode 100644 index 0000000000..aae28c16bf --- /dev/null +++ b/packages/turf-line-arc/test/out/line-arc-one-step.geojson @@ -0,0 +1,34 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "steps": 1, + "radius": 500, + "bearing1": 60, + "bearing2": 65 + }, + "geometry": { + "type": "Point", + "coordinates": [11.343, 44.495] + } + }, + { + "type": "Feature", + "properties": { + "steps": 1, + "radius": 500, + "bearing1": 60, + "bearing2": 65 + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [17.014763, 46.606416], + [17.240322, 46.246701] + ] + } + } + ] +} diff --git a/packages/turf-line-arc/test/out/line-arc-zero-steps.geojson b/packages/turf-line-arc/test/out/line-arc-zero-steps.geojson new file mode 100644 index 0000000000..c43632b441 --- /dev/null +++ b/packages/turf-line-arc/test/out/line-arc-zero-steps.geojson @@ -0,0 +1,97 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "steps": 0, + "radius": 500, + "bearing1": 60, + "bearing2": 65 + }, + "geometry": { + "type": "Point", + "coordinates": [11.343, 44.495] + } + }, + { + "type": "Feature", + "properties": { + "steps": 0, + "radius": 500, + "bearing1": 60, + "bearing2": 65 + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [17.014763, 46.606416], + [17.018658, 46.600907], + [17.022542, 46.595393], + [17.026413, 46.589876], + [17.030274, 46.584356], + [17.034122, 46.578831], + [17.037959, 46.573303], + [17.041784, 46.567771], + [17.045597, 46.562236], + [17.049399, 46.556697], + [17.053189, 46.551154], + [17.056967, 46.545607], + [17.060733, 46.540057], + [17.064488, 46.534503], + [17.068231, 46.528946], + [17.071962, 46.523385], + [17.075682, 46.51782], + [17.079389, 46.512252], + [17.083085, 46.50668], + [17.086769, 46.501105], + [17.090442, 46.495526], + [17.094102, 46.489943], + [17.097751, 46.484357], + [17.101388, 46.478768], + [17.105013, 46.473174], + [17.108627, 46.467578], + [17.112228, 46.461978], + [17.115818, 46.456374], + [17.119396, 46.450767], + [17.122963, 46.445157], + [17.126517, 46.439543], + [17.13006, 46.433925], + [17.133591, 46.428305], + [17.13711, 46.42268], + [17.140617, 46.417053], + [17.144112, 46.411422], + [17.147596, 46.405787], + [17.151068, 46.40015], + [17.154528, 46.394508], + [17.157976, 46.388864], + [17.161412, 46.383216], + [17.164836, 46.377565], + [17.168249, 46.371911], + [17.171649, 46.366253], + [17.175038, 46.360592], + [17.178415, 46.354928], + [17.18178, 46.34926], + [17.185134, 46.34359], + [17.188475, 46.337916], + [17.191805, 46.332238], + [17.195122, 46.326558], + [17.198428, 46.320874], + [17.201722, 46.315187], + [17.205004, 46.309497], + [17.208274, 46.303804], + [17.211533, 46.298108], + [17.214779, 46.292408], + [17.218013, 46.286706], + [17.221236, 46.281], + [17.224447, 46.275291], + [17.227646, 46.269579], + [17.230832, 46.263864], + [17.234007, 46.258146], + [17.237171, 46.252425], + [17.240322, 46.246701] + ] + } + } + ] +} diff --git a/packages/turf-line-arc/test/out/line-arc1.geojson b/packages/turf-line-arc/test/out/line-arc1.geojson index 6e994aab21..85e64cac6f 100644 --- a/packages/turf-line-arc/test/out/line-arc1.geojson +++ b/packages/turf-line-arc/test/out/line-arc1.geojson @@ -24,12 +24,68 @@ "type": "LineString", "coordinates": [ [11.364576, 44.537252], + [11.365221, 44.537082], + [11.365864, 44.536906], + [11.366504, 44.536726], + [11.367141, 44.536541], + [11.367775, 44.53635], + [11.368406, 44.536155], + [11.369035, 44.535955], + [11.36966, 44.53575], [11.370282, 44.53554], + [11.3709, 44.535325], + [11.371516, 44.535106], + [11.372128, 44.534882], + [11.372736, 44.534653], + [11.373341, 44.534419], + [11.373943, 44.53418], + [11.37454, 44.533937], + [11.375134, 44.53369], [11.375724, 44.533437], + [11.37631, 44.53318], + [11.376893, 44.532919], + [11.377471, 44.532653], + [11.378045, 44.532383], + [11.378615, 44.532108], + [11.37918, 44.531828], + [11.379741, 44.531545], + [11.380298, 44.531257], [11.380851, 44.530964], + [11.381399, 44.530668], + [11.381942, 44.530367], + [11.382481, 44.530062], + [11.383015, 44.529752], + [11.383544, 44.529439], + [11.384069, 44.529121], + [11.384588, 44.5288], + [11.385103, 44.528474], [11.385612, 44.528145], + [11.386117, 44.527811], + [11.386616, 44.527474], + [11.38711, 44.527132], + [11.387599, 44.526787], + [11.388083, 44.526438], + [11.388561, 44.526086], + [11.389034, 44.525729], + [11.389501, 44.525369], [11.389963, 44.525006], + [11.390419, 44.524638], + [11.390869, 44.524268], + [11.391314, 44.523893], + [11.391753, 44.523516], + [11.392186, 44.523135], + [11.392614, 44.52275], + [11.393035, 44.522363], + [11.393451, 44.521972], [11.39386, 44.521578], + [11.394264, 44.52118], + [11.394661, 44.52078], + [11.395052, 44.520376], + [11.395437, 44.51997], + [11.395816, 44.51956], + [11.396188, 44.519148], + [11.396554, 44.518733], + [11.396914, 44.518314], [11.397267, 44.517894], [11.397614, 44.51747] ] diff --git a/packages/turf-line-arc/test/out/line-arc2.geojson b/packages/turf-line-arc/test/out/line-arc2.geojson index 549b40f5ee..7c27ae39b7 100644 --- a/packages/turf-line-arc/test/out/line-arc2.geojson +++ b/packages/turf-line-arc/test/out/line-arc2.geojson @@ -24,29 +24,69 @@ "type": "LineString", "coordinates": [ [11.406038, 44.494983], - [11.40573, 44.490575], - [11.404818, 44.486211], + [11.405994, 44.493328], + [11.405864, 44.491675], + [11.405649, 44.490027], + [11.405349, 44.488385], + [11.404965, 44.486753], + [11.404496, 44.485131], + [11.403945, 44.483524], [11.40331, 44.481931], - [11.401223, 44.477777], - [11.398575, 44.47379], + [11.402595, 44.480357], + [11.401798, 44.478802], + [11.400922, 44.477269], + [11.399967, 44.47576], + [11.398936, 44.474278], + [11.397828, 44.472823], + [11.396646, 44.471399], [11.395392, 44.470006], - [11.391706, 44.466464], - [11.387551, 44.463196], + [11.394067, 44.468648], + [11.392673, 44.467325], + [11.391211, 44.466039], + [11.389684, 44.464793], + [11.388094, 44.463588], + [11.386443, 44.462425], + [11.384734, 44.461307], [11.382967, 44.460234], - [11.378, 44.457607], - [11.372696, 44.45534], + [11.381147, 44.459208], + [11.379275, 44.458231], + [11.377354, 44.457303], + [11.375387, 44.456427], + [11.373376, 44.455603], + [11.371323, 44.454832], + [11.369233, 44.454115], [11.367107, 44.453454], - [11.361286, 44.451969], - [11.355289, 44.450897], + [11.364948, 44.452849], + [11.36276, 44.452302], + [11.360544, 44.451812], + [11.358306, 44.451381], + [11.356046, 44.451008], + [11.353769, 44.450695], + [11.351477, 44.450443], [11.349174, 44.45025], - [11.343, 44.450034], - [11.336826, 44.45025], + [11.346863, 44.450119], + [11.344546, 44.450048], + [11.342227, 44.450037], + [11.339909, 44.450088], + [11.337596, 44.4502], + [11.335289, 44.450372], + [11.332993, 44.450605], [11.330711, 44.450897], - [11.324714, 44.451969], - [11.318893, 44.453454], + [11.328445, 44.45125], + [11.326199, 44.451662], + [11.323976, 44.452132], + [11.321778, 44.452661], + [11.31961, 44.453246], + [11.317472, 44.453889], + [11.315369, 44.454587], [11.313304, 44.45534], - [11.308, 44.457607], - [11.303033, 44.460234], + [11.311279, 44.456146], + [11.309297, 44.457005], + [11.30736, 44.457916], + [11.305471, 44.458877], + [11.303634, 44.459887], + [11.301849, 44.460944], + [11.30012, 44.462047], [11.298449, 44.463196] ] } diff --git a/packages/turf-line-arc/test/out/line-arc3.geojson b/packages/turf-line-arc/test/out/line-arc3.geojson index 3dbbd0c9f6..33911f2cc8 100644 --- a/packages/turf-line-arc/test/out/line-arc3.geojson +++ b/packages/turf-line-arc/test/out/line-arc3.geojson @@ -24,53 +24,69 @@ "type": "LineString", "coordinates": [ [11.387599, 44.526787], - [11.391753, 44.523516], - [11.395437, 44.51997], + [11.390757, 44.524361], + [11.393656, 44.521775], + [11.39628, 44.519044], [11.398615, 44.516183], - [11.401257, 44.512193], - [11.403337, 44.508037], + [11.400648, 44.513208], + [11.402369, 44.510133], + [11.403767, 44.506977], [11.404836, 44.503756], - [11.40574, 44.49939], - [11.406038, 44.494983], + [11.40557, 44.500487], + [11.405965, 44.497189], + [11.406018, 44.493879], [11.40573, 44.490575], - [11.404818, 44.486211], - [11.40331, 44.481931], + [11.405102, 44.487296], + [11.404138, 44.484058], + [11.402842, 44.480879], [11.401223, 44.477777], - [11.398575, 44.47379], - [11.395392, 44.470006], + [11.399288, 44.474769], + [11.397048, 44.47187], + [11.394516, 44.469097], [11.391706, 44.466464], - [11.387551, 44.463196], - [11.382967, 44.460234], + [11.388631, 44.463985], + [11.38531, 44.461675], + [11.38176, 44.459545], [11.378, 44.457607], - [11.372696, 44.45534], - [11.367107, 44.453454], + [11.374051, 44.455871], + [11.369934, 44.454348], + [11.365671, 44.453045], [11.361286, 44.451969], - [11.355289, 44.450897], - [11.349174, 44.45025], + [11.356801, 44.451126], + [11.352243, 44.45052], + [11.347634, 44.450156], [11.343, 44.450034], - [11.336826, 44.45025], - [11.330711, 44.450897], + [11.338366, 44.450156], + [11.333757, 44.45052], + [11.329199, 44.451126], [11.324714, 44.451969], - [11.318893, 44.453454], - [11.313304, 44.45534], + [11.320329, 44.453045], + [11.316066, 44.454348], + [11.311949, 44.455871], [11.308, 44.457607], - [11.303033, 44.460234], - [11.298449, 44.463196], + [11.30424, 44.459545], + [11.30069, 44.461675], + [11.297369, 44.463985], [11.294294, 44.466464], - [11.290608, 44.470006], - [11.287425, 44.47379], + [11.291484, 44.469097], + [11.288952, 44.47187], + [11.286712, 44.474769], [11.284777, 44.477777], - [11.28269, 44.481931], - [11.281182, 44.486211], + [11.283158, 44.480879], + [11.281862, 44.484058], + [11.280898, 44.487296], [11.28027, 44.490575], - [11.279962, 44.494983], - [11.28026, 44.49939], + [11.279982, 44.493879], + [11.280035, 44.497189], + [11.28043, 44.500487], [11.281164, 44.503756], - [11.282663, 44.508037], - [11.284743, 44.512193], + [11.282233, 44.506977], + [11.283631, 44.510133], + [11.285352, 44.513208], [11.287385, 44.516183], - [11.290563, 44.51997], - [11.294247, 44.523516], + [11.28972, 44.519044], + [11.292344, 44.521775], + [11.295243, 44.524361], [11.298401, 44.526787] ] } diff --git a/packages/turf-line-arc/test/out/line-arc4.geojson b/packages/turf-line-arc/test/out/line-arc4.geojson index 07450bbffc..ca1afface3 100644 --- a/packages/turf-line-arc/test/out/line-arc4.geojson +++ b/packages/turf-line-arc/test/out/line-arc4.geojson @@ -24,12 +24,69 @@ "type": "LineString", "coordinates": [ [11.294686, 44.523893], - [11.29889, 44.527132], - [11.303519, 44.530062], - [11.308529, 44.532653], - [11.313872, 44.534882], - [11.319496, 44.536726], - [11.325347, 44.538168], + [11.295075, 44.524221], + [11.295468, 44.524546], + [11.295866, 44.524868], + [11.296267, 44.525188], + [11.296674, 44.525505], + [11.297084, 44.525819], + [11.297499, 44.52613], + [11.297917, 44.526438], + [11.29834, 44.526744], + [11.298767, 44.527046], + [11.299198, 44.527346], + [11.299633, 44.527643], + [11.300072, 44.527937], + [11.300515, 44.528227], + [11.300961, 44.528515], + [11.301412, 44.5288], + [11.301866, 44.529081], + [11.302324, 44.52936], + [11.302786, 44.529635], + [11.303251, 44.529907], + [11.303721, 44.530176], + [11.304193, 44.530442], + [11.304669, 44.530705], + [11.305149, 44.530964], + [11.305632, 44.53122], + [11.306119, 44.531473], + [11.306609, 44.531722], + [11.307102, 44.531969], + [11.307599, 44.532211], + [11.308098, 44.532451], + [11.308601, 44.532686], + [11.309107, 44.532919], + [11.309617, 44.533148], + [11.310129, 44.533374], + [11.310644, 44.533596], + [11.311162, 44.533814], + [11.311683, 44.534029], + [11.312207, 44.534241], + [11.312734, 44.534448], + [11.313264, 44.534653], + [11.313796, 44.534853], + [11.314331, 44.53505], + [11.314868, 44.535244], + [11.315408, 44.535433], + [11.315951, 44.535619], + [11.316496, 44.535802], + [11.317044, 44.53598], + [11.317594, 44.536155], + [11.318146, 44.536326], + [11.3187, 44.536494], + [11.319257, 44.536657], + [11.319816, 44.536817], + [11.320377, 44.536973], + [11.32094, 44.537125], + [11.321505, 44.537273], + [11.322072, 44.537418], + [11.322641, 44.537558], + [11.323212, 44.537695], + [11.323784, 44.537828], + [11.324358, 44.537956], + [11.324934, 44.538081], + [11.325512, 44.538202], + [11.326091, 44.53832], [11.326672, 44.538433] ] } diff --git a/packages/turf-line-arc/test/out/line-arc5.geojson b/packages/turf-line-arc/test/out/line-arc5.geojson index 22a8135324..5f6dfc5d5f 100644 --- a/packages/turf-line-arc/test/out/line-arc5.geojson +++ b/packages/turf-line-arc/test/out/line-arc5.geojson @@ -24,63 +24,69 @@ "type": "LineString", "coordinates": [ [11.326672, 44.538433], - [11.332724, 44.539365], - [11.338874, 44.53987], - [11.345064, 44.539942], - [11.351234, 44.539581], - [11.357325, 44.53879], - [11.363278, 44.537578], - [11.369035, 44.535955], - [11.37454, 44.533937], - [11.379741, 44.531545], - [11.384588, 44.5288], - [11.389034, 44.525729], - [11.393035, 44.522363], - [11.396554, 44.518733], - [11.399557, 44.514874], - [11.402014, 44.510824], - [11.403903, 44.506622], - [11.405204, 44.502308], - [11.405907, 44.497924], - [11.406003, 44.493511], - [11.405493, 44.489114], - [11.404381, 44.484773], - [11.402678, 44.480531], - [11.400401, 44.476428], - [11.397572, 44.472504], - [11.394218, 44.468797], - [11.390371, 44.465342], - [11.386068, 44.462173], - [11.381352, 44.45932], - [11.376267, 44.45681], - [11.370862, 44.454668], - [11.365189, 44.452914], - [11.359303, 44.451565], - [11.353261, 44.450634], - [11.34712, 44.45013], - [11.340939, 44.450058], - [11.334778, 44.450418], - [11.328696, 44.451208], - [11.322752, 44.452419], - [11.317002, 44.454039], - [11.311502, 44.456054], - [11.306305, 44.458444], - [11.30146, 44.461185], - [11.297015, 44.464252], - [11.293012, 44.467616], - [11.289489, 44.471242], - [11.286482, 44.475098], - [11.284018, 44.479146], - [11.282122, 44.483346], - [11.280811, 44.487658], - [11.2801, 44.492042], - [11.279994, 44.496454], - [11.280495, 44.500852], - [11.281598, 44.505194], - [11.283292, 44.509438], - [11.285562, 44.513543], - [11.288386, 44.51747], - [11.291736, 44.52118], + [11.33213, 44.539293], + [11.337673, 44.539805], + [11.343258, 44.539966], + [11.348841, 44.539773], + [11.354378, 44.539228], + [11.359826, 44.538336], + [11.365141, 44.537103], + [11.370282, 44.53554], + [11.375208, 44.533658], + [11.379881, 44.531473], + [11.384264, 44.529001], + [11.388323, 44.526262], + [11.392025, 44.523278], + [11.395341, 44.520072], + [11.398247, 44.516669], + [11.400718, 44.513095], + [11.402735, 44.50938], + [11.404284, 44.505552], + [11.405351, 44.501642], + [11.405928, 44.497679], + [11.406011, 44.493695], + [11.4056, 44.489722], + [11.404697, 44.48579], + [11.40331, 44.481931], + [11.401451, 44.478175], + [11.399132, 44.47455], + [11.396374, 44.471086], + [11.393197, 44.46781], + [11.389626, 44.464748], + [11.385691, 44.461923], + [11.38142, 44.459357], + [11.376848, 44.457071], + [11.372012, 44.455083], + [11.366948, 44.453408], + [11.361696, 44.452059], + [11.356298, 44.451047], + [11.350796, 44.450379], + [11.345233, 44.450062], + [11.339652, 44.450097], + [11.334097, 44.450485], + [11.328613, 44.451222], + [11.32324, 44.452302], + [11.318023, 44.453717], + [11.313001, 44.455456], + [11.308215, 44.457505], + [11.303701, 44.459848], + [11.299495, 44.462468], + [11.295629, 44.465342], + [11.292135, 44.468449], + [11.28904, 44.471765], + [11.286368, 44.475263], + [11.28414, 44.478916], + [11.282374, 44.482696], + [11.281083, 44.486572], + [11.280278, 44.490514], + [11.279966, 44.494492], + [11.280148, 44.498474], + [11.280824, 44.502429], + [11.281988, 44.506325], + [11.283631, 44.510133], + [11.285741, 44.513822], + [11.2883, 44.517364], + [11.29129, 44.52073], [11.294686, 44.523893] ] } diff --git a/packages/turf-line-arc/test/out/line-arc6.geojson b/packages/turf-line-arc/test/out/line-arc6.geojson index 6db88b05c9..46d44a0ff8 100644 --- a/packages/turf-line-arc/test/out/line-arc6.geojson +++ b/packages/turf-line-arc/test/out/line-arc6.geojson @@ -24,61 +24,68 @@ "type": "LineString", "coordinates": [ [11.397614, 44.51747], - [11.400438, 44.513543], - [11.402708, 44.509438], - [11.404402, 44.505194], - [11.405505, 44.500852], - [11.406006, 44.496454], - [11.4059, 44.492042], - [11.405189, 44.487658], + [11.400151, 44.513989], + [11.402252, 44.510364], + [11.403903, 44.506622], + [11.405089, 44.502791], + [11.405803, 44.498902], + [11.406038, 44.494983], + [11.405794, 44.491064], + [11.405072, 44.487175], [11.403878, 44.483346], - [11.401982, 44.479146], - [11.399518, 44.475098], - [11.396511, 44.471242], - [11.392988, 44.467616], - [11.388985, 44.464252], - [11.38454, 44.461185], - [11.379695, 44.458444], + [11.402221, 44.479605], + [11.400114, 44.475982], + [11.397572, 44.472504], + [11.394615, 44.469197], + [11.391266, 44.466086], + [11.387551, 44.463196], + [11.383496, 44.460547], + [11.379135, 44.45816], [11.374498, 44.456054], - [11.368998, 44.454039], - [11.363248, 44.452419], - [11.357304, 44.451208], - [11.351222, 44.450418], - [11.345061, 44.450058], - [11.33888, 44.45013], - [11.332739, 44.450634], + [11.369623, 44.454244], + [11.364545, 44.452744], + [11.359303, 44.451565], + [11.353938, 44.450717], + [11.34849, 44.450205], + [11.343, 44.450034], + [11.33751, 44.450205], + [11.332062, 44.450717], [11.326697, 44.451565], - [11.320811, 44.452914], - [11.315138, 44.454668], - [11.309733, 44.45681], - [11.304648, 44.45932], - [11.299932, 44.462173], - [11.295629, 44.465342], - [11.291782, 44.468797], + [11.321455, 44.452744], + [11.316377, 44.454244], + [11.311502, 44.456054], + [11.306865, 44.45816], + [11.302504, 44.460547], + [11.298449, 44.463196], + [11.294734, 44.466086], + [11.291385, 44.469197], [11.288428, 44.472504], - [11.285599, 44.476428], - [11.283322, 44.480531], - [11.281619, 44.484773], - [11.280507, 44.489114], - [11.279997, 44.493511], - [11.280093, 44.497924], - [11.280796, 44.502308], + [11.285886, 44.475982], + [11.283779, 44.479605], + [11.282122, 44.483346], + [11.280928, 44.487175], + [11.280206, 44.491064], + [11.279962, 44.494983], + [11.280197, 44.498902], + [11.280911, 44.502791], [11.282097, 44.506622], - [11.283986, 44.510824], - [11.286443, 44.514874], - [11.289446, 44.518733], - [11.292965, 44.522363], - [11.296966, 44.525729], - [11.301412, 44.5288], - [11.306259, 44.531545], + [11.283748, 44.510364], + [11.285849, 44.513989], + [11.288386, 44.51747], + [11.291339, 44.52078], + [11.294686, 44.523893], + [11.298401, 44.526787], + [11.302456, 44.529439], + [11.30682, 44.531828], [11.31146, 44.533937], - [11.316965, 44.535955], - [11.322722, 44.537578], - [11.328675, 44.53879], - [11.334766, 44.539581], - [11.340936, 44.539942], - [11.347126, 44.53987], - [11.353276, 44.539365], + [11.31634, 44.53575], + [11.321424, 44.537252], + [11.326672, 44.538433], + [11.332045, 44.539282], + [11.337502, 44.539795], + [11.343, 44.539966], + [11.348498, 44.539795], + [11.353955, 44.539282], [11.359328, 44.538433], [11.364576, 44.537252] ] diff --git a/packages/turf-line-arc/test/out/line-arc7.geojson b/packages/turf-line-arc/test/out/line-arc7.geojson new file mode 100644 index 0000000000..ede1081731 --- /dev/null +++ b/packages/turf-line-arc/test/out/line-arc7.geojson @@ -0,0 +1,95 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "radius": 500, + "bearing1": 60, + "bearing2": 65 + }, + "geometry": { + "type": "Point", + "coordinates": [11.343, 44.495] + } + }, + { + "type": "Feature", + "properties": { + "radius": 500, + "bearing1": 60, + "bearing2": 65 + }, + "geometry": { + "type": "LineString", + "coordinates": [ + [17.014763, 46.606416], + [17.018658, 46.600907], + [17.022542, 46.595393], + [17.026413, 46.589876], + [17.030274, 46.584356], + [17.034122, 46.578831], + [17.037959, 46.573303], + [17.041784, 46.567771], + [17.045597, 46.562236], + [17.049399, 46.556697], + [17.053189, 46.551154], + [17.056967, 46.545607], + [17.060733, 46.540057], + [17.064488, 46.534503], + [17.068231, 46.528946], + [17.071962, 46.523385], + [17.075682, 46.51782], + [17.079389, 46.512252], + [17.083085, 46.50668], + [17.086769, 46.501105], + [17.090442, 46.495526], + [17.094102, 46.489943], + [17.097751, 46.484357], + [17.101388, 46.478768], + [17.105013, 46.473174], + [17.108627, 46.467578], + [17.112228, 46.461978], + [17.115818, 46.456374], + [17.119396, 46.450767], + [17.122963, 46.445157], + [17.126517, 46.439543], + [17.13006, 46.433925], + [17.133591, 46.428305], + [17.13711, 46.42268], + [17.140617, 46.417053], + [17.144112, 46.411422], + [17.147596, 46.405787], + [17.151068, 46.40015], + [17.154528, 46.394508], + [17.157976, 46.388864], + [17.161412, 46.383216], + [17.164836, 46.377565], + [17.168249, 46.371911], + [17.171649, 46.366253], + [17.175038, 46.360592], + [17.178415, 46.354928], + [17.18178, 46.34926], + [17.185134, 46.34359], + [17.188475, 46.337916], + [17.191805, 46.332238], + [17.195122, 46.326558], + [17.198428, 46.320874], + [17.201722, 46.315187], + [17.205004, 46.309497], + [17.208274, 46.303804], + [17.211533, 46.298108], + [17.214779, 46.292408], + [17.218013, 46.286706], + [17.221236, 46.281], + [17.224447, 46.275291], + [17.227646, 46.269579], + [17.230832, 46.263864], + [17.234007, 46.258146], + [17.237171, 46.252425], + [17.240322, 46.246701] + ] + } + } + ] +} diff --git a/packages/turf-sector/test/out/pacman.geojson b/packages/turf-sector/test/out/pacman.geojson index 1b41af6efb..9fe79eb621 100644 --- a/packages/turf-sector/test/out/pacman.geojson +++ b/packages/turf-sector/test/out/pacman.geojson @@ -28,57 +28,69 @@ [ [176.868896, -17.821916], [178.151889, -18.668804], - [178.058456, -18.784436], - [177.953377, -18.890786], - [177.837661, -18.986812], - [177.712424, -19.071569], - [177.578885, -19.144225], - [177.438347, -19.204064], - [177.292191, -19.250494], - [177.141855, -19.283058], - [176.988821, -19.301433], - [176.834601, -19.305438], - [176.68072, -19.295033], - [176.5287, -19.270321], - [176.38004, -19.231546], - [176.236207, -19.179092], - [176.098614, -19.113476], - [175.968609, -19.035346], - [175.847459, -18.945471], - [175.736338, -18.844734], - [175.636317, -18.734125], - [175.548353, -18.614725], - [175.473276, -18.487703], - [175.411789, -18.354295], - [175.364456, -18.2158], - [175.331703, -18.073561], - [175.313809, -17.928954], - [175.31091, -17.783376], - [175.322999, -17.638227], - [175.349922, -17.494902], + [178.077565, -18.762645], + [177.995563, -18.850599], + [177.906393, -18.932108], + [177.810611, -19.006651], + [177.708821, -19.073754], + [177.601663, -19.132988], + [177.489819, -19.183974], + [177.373999, -19.226385], + [177.254942, -19.25995], + [177.13341, -19.284453], + [177.010181, -19.299738], + [176.886045, -19.305705], + [176.7618, -19.302317], + [176.638241, -19.289596], + [176.516163, -19.267622], + [176.396346, -19.236538], + [176.279558, -19.196542], + [176.166545, -19.147892], + [176.058025, -19.090898], + [175.954688, -19.025925], + [175.857187, -18.953388], + [175.766135, -18.873751], + [175.682103, -18.787521], + [175.605613, -18.695246], + [175.537137, -18.597512], + [175.477096, -18.494939], + [175.425853, -18.388176], + [175.383715, -18.277896], + [175.350929, -18.164796], + [175.327683, -18.049587], + [175.314104, -17.932991], + [175.310257, -17.815739], + [175.316147, -17.698564], + [175.331719, -17.582197], + [175.356857, -17.467363], [175.391387, -17.354776], - [175.446966, -17.219186], - [175.516098, -17.089428], - [175.598098, -16.966736], - [175.692164, -16.852276], - [175.797383, -16.747135], - [175.912741, -16.652309], - [176.037134, -16.568694], - [176.169378, -16.49708], - [176.308217, -16.438144], - [176.452337, -16.39244], - [176.600379, -16.3604], - [176.750947, -16.342326], - [176.902626, -16.338387], - [177.053986, -16.348621], - [177.203606, -16.372931], - [177.350075, -16.411089], - [177.492014, -16.462734], - [177.62808, -16.527381], - [177.756986, -16.604419], - [177.877506, -16.693121], - [177.988489, -16.792648], - [178.08887, -16.902059], + [175.435078, -17.245134], + [175.487644, -17.139116], + [175.548744, -17.037379], + [175.617989, -16.940549], + [175.694941, -16.849225], + [175.779113, -16.763968], + [175.869982, -16.685303], + [175.96698, -16.613713], + [176.069507, -16.549637], + [176.17693, -16.493468], + [176.288587, -16.445549], + [176.403793, -16.406175], + [176.521842, -16.375586], + [176.64201, -16.353969], + [176.763565, -16.341457], + [176.885762, -16.338124], + [177.007856, -16.343994], + [177.129102, -16.359028], + [177.248759, -16.383135], + [177.366095, -16.416169], + [177.480392, -16.457926], + [177.590948, -16.508152], + [177.697086, -16.566539], + [177.79815, -16.632729], + [177.893515, -16.706317], + [177.982592, -16.786851], + [178.064823, -16.873835], [178.139695, -16.966736], [176.868896, -17.821916] ] diff --git a/packages/turf-sector/test/out/sector-greater-360.geojson b/packages/turf-sector/test/out/sector-greater-360.geojson index 48e310d91b..9a8c59ce04 100644 --- a/packages/turf-sector/test/out/sector-greater-360.geojson +++ b/packages/turf-sector/test/out/sector-greater-360.geojson @@ -28,9 +28,69 @@ [ [11.343, 44.495], [11.343, 44.539966], + [11.343344, 44.539965], + [11.343688, 44.539963], + [11.344032, 44.53996], + [11.344376, 44.539955], + [11.34472, 44.539949], + [11.345064, 44.539942], + [11.345408, 44.539933], + [11.345752, 44.539923], + [11.346096, 44.539912], + [11.346439, 44.539899], + [11.346783, 44.539885], + [11.347126, 44.53987], + [11.347469, 44.539853], + [11.347813, 44.539835], + [11.348156, 44.539816], + [11.348498, 44.539795], + [11.348841, 44.539773], [11.349184, 44.539749], + [11.349526, 44.539725], + [11.349868, 44.539699], + [11.35021, 44.539671], + [11.350552, 44.539642], + [11.350893, 44.539612], + [11.351234, 44.539581], + [11.351575, 44.539548], + [11.351916, 44.539514], + [11.352257, 44.539479], + [11.352597, 44.539442], + [11.352937, 44.539404], + [11.353276, 44.539365], + [11.353616, 44.539324], + [11.353955, 44.539282], + [11.354294, 44.539239], + [11.354632, 44.539194], + [11.35497, 44.539149], [11.355307, 44.539101], + [11.355645, 44.539053], + [11.355982, 44.539003], + [11.356318, 44.538952], + [11.356654, 44.538899], + [11.35699, 44.538846], + [11.357325, 44.53879], + [11.35766, 44.538734], + [11.357995, 44.538676], + [11.358329, 44.538617], + [11.358662, 44.538557], + [11.358995, 44.538496], + [11.359328, 44.538433], + [11.35966, 44.538369], + [11.359991, 44.538303], + [11.360322, 44.538236], + [11.360653, 44.538168], + [11.360983, 44.538099], [11.361313, 44.538028], + [11.361642, 44.537956], + [11.36197, 44.537883], + [11.362298, 44.537809], + [11.362625, 44.537733], + [11.362952, 44.537656], + [11.363278, 44.537578], + [11.363603, 44.537498], + [11.363928, 44.537418], + [11.364252, 44.537336], [11.364576, 44.537252], [11.343, 44.495] ] diff --git a/packages/turf-sector/test/out/sector1.geojson b/packages/turf-sector/test/out/sector1.geojson index 2a13bfcfe9..c38e4a345f 100644 --- a/packages/turf-sector/test/out/sector1.geojson +++ b/packages/turf-sector/test/out/sector1.geojson @@ -28,12 +28,68 @@ [ [11.343, 44.495], [11.364576, 44.537252], + [11.365221, 44.537082], + [11.365864, 44.536906], + [11.366504, 44.536726], + [11.367141, 44.536541], + [11.367775, 44.53635], + [11.368406, 44.536155], + [11.369035, 44.535955], + [11.36966, 44.53575], [11.370282, 44.53554], + [11.3709, 44.535325], + [11.371516, 44.535106], + [11.372128, 44.534882], + [11.372736, 44.534653], + [11.373341, 44.534419], + [11.373943, 44.53418], + [11.37454, 44.533937], + [11.375134, 44.53369], [11.375724, 44.533437], + [11.37631, 44.53318], + [11.376893, 44.532919], + [11.377471, 44.532653], + [11.378045, 44.532383], + [11.378615, 44.532108], + [11.37918, 44.531828], + [11.379741, 44.531545], + [11.380298, 44.531257], [11.380851, 44.530964], + [11.381399, 44.530668], + [11.381942, 44.530367], + [11.382481, 44.530062], + [11.383015, 44.529752], + [11.383544, 44.529439], + [11.384069, 44.529121], + [11.384588, 44.5288], + [11.385103, 44.528474], [11.385612, 44.528145], + [11.386117, 44.527811], + [11.386616, 44.527474], + [11.38711, 44.527132], + [11.387599, 44.526787], + [11.388083, 44.526438], + [11.388561, 44.526086], + [11.389034, 44.525729], + [11.389501, 44.525369], [11.389963, 44.525006], + [11.390419, 44.524638], + [11.390869, 44.524268], + [11.391314, 44.523893], + [11.391753, 44.523516], + [11.392186, 44.523135], + [11.392614, 44.52275], + [11.393035, 44.522363], + [11.393451, 44.521972], [11.39386, 44.521578], + [11.394264, 44.52118], + [11.394661, 44.52078], + [11.395052, 44.520376], + [11.395437, 44.51997], + [11.395816, 44.51956], + [11.396188, 44.519148], + [11.396554, 44.518733], + [11.396914, 44.518314], [11.397267, 44.517894], [11.397614, 44.51747], [11.343, 44.495] diff --git a/packages/turf-sector/test/out/sector2.geojson b/packages/turf-sector/test/out/sector2.geojson index 830086f818..f175f3d260 100644 --- a/packages/turf-sector/test/out/sector2.geojson +++ b/packages/turf-sector/test/out/sector2.geojson @@ -28,29 +28,69 @@ [ [11.343, 44.495], [11.406038, 44.494983], - [11.40573, 44.490575], - [11.404818, 44.486211], + [11.405994, 44.493328], + [11.405864, 44.491675], + [11.405649, 44.490027], + [11.405349, 44.488385], + [11.404965, 44.486753], + [11.404496, 44.485131], + [11.403945, 44.483524], [11.40331, 44.481931], - [11.401223, 44.477777], - [11.398575, 44.47379], + [11.402595, 44.480357], + [11.401798, 44.478802], + [11.400922, 44.477269], + [11.399967, 44.47576], + [11.398936, 44.474278], + [11.397828, 44.472823], + [11.396646, 44.471399], [11.395392, 44.470006], - [11.391706, 44.466464], - [11.387551, 44.463196], + [11.394067, 44.468648], + [11.392673, 44.467325], + [11.391211, 44.466039], + [11.389684, 44.464793], + [11.388094, 44.463588], + [11.386443, 44.462425], + [11.384734, 44.461307], [11.382967, 44.460234], - [11.378, 44.457607], - [11.372696, 44.45534], + [11.381147, 44.459208], + [11.379275, 44.458231], + [11.377354, 44.457303], + [11.375387, 44.456427], + [11.373376, 44.455603], + [11.371323, 44.454832], + [11.369233, 44.454115], [11.367107, 44.453454], - [11.361286, 44.451969], - [11.355289, 44.450897], + [11.364948, 44.452849], + [11.36276, 44.452302], + [11.360544, 44.451812], + [11.358306, 44.451381], + [11.356046, 44.451008], + [11.353769, 44.450695], + [11.351477, 44.450443], [11.349174, 44.45025], - [11.343, 44.450034], - [11.336826, 44.45025], + [11.346863, 44.450119], + [11.344546, 44.450048], + [11.342227, 44.450037], + [11.339909, 44.450088], + [11.337596, 44.4502], + [11.335289, 44.450372], + [11.332993, 44.450605], [11.330711, 44.450897], - [11.324714, 44.451969], - [11.318893, 44.453454], + [11.328445, 44.45125], + [11.326199, 44.451662], + [11.323976, 44.452132], + [11.321778, 44.452661], + [11.31961, 44.453246], + [11.317472, 44.453889], + [11.315369, 44.454587], [11.313304, 44.45534], - [11.308, 44.457607], - [11.303033, 44.460234], + [11.311279, 44.456146], + [11.309297, 44.457005], + [11.30736, 44.457916], + [11.305471, 44.458877], + [11.303634, 44.459887], + [11.301849, 44.460944], + [11.30012, 44.462047], [11.298449, 44.463196], [11.343, 44.495] ] diff --git a/packages/turf-sector/test/out/sector3.geojson b/packages/turf-sector/test/out/sector3.geojson index 9bf2b8642a..dec78ee084 100644 --- a/packages/turf-sector/test/out/sector3.geojson +++ b/packages/turf-sector/test/out/sector3.geojson @@ -28,53 +28,69 @@ [ [11.343, 44.495], [11.387599, 44.526787], - [11.391753, 44.523516], - [11.395437, 44.51997], + [11.390757, 44.524361], + [11.393656, 44.521775], + [11.39628, 44.519044], [11.398615, 44.516183], - [11.401257, 44.512193], - [11.403337, 44.508037], + [11.400648, 44.513208], + [11.402369, 44.510133], + [11.403767, 44.506977], [11.404836, 44.503756], - [11.40574, 44.49939], - [11.406038, 44.494983], + [11.40557, 44.500487], + [11.405965, 44.497189], + [11.406018, 44.493879], [11.40573, 44.490575], - [11.404818, 44.486211], - [11.40331, 44.481931], + [11.405102, 44.487296], + [11.404138, 44.484058], + [11.402842, 44.480879], [11.401223, 44.477777], - [11.398575, 44.47379], - [11.395392, 44.470006], + [11.399288, 44.474769], + [11.397048, 44.47187], + [11.394516, 44.469097], [11.391706, 44.466464], - [11.387551, 44.463196], - [11.382967, 44.460234], + [11.388631, 44.463985], + [11.38531, 44.461675], + [11.38176, 44.459545], [11.378, 44.457607], - [11.372696, 44.45534], - [11.367107, 44.453454], + [11.374051, 44.455871], + [11.369934, 44.454348], + [11.365671, 44.453045], [11.361286, 44.451969], - [11.355289, 44.450897], - [11.349174, 44.45025], + [11.356801, 44.451126], + [11.352243, 44.45052], + [11.347634, 44.450156], [11.343, 44.450034], - [11.336826, 44.45025], - [11.330711, 44.450897], + [11.338366, 44.450156], + [11.333757, 44.45052], + [11.329199, 44.451126], [11.324714, 44.451969], - [11.318893, 44.453454], - [11.313304, 44.45534], + [11.320329, 44.453045], + [11.316066, 44.454348], + [11.311949, 44.455871], [11.308, 44.457607], - [11.303033, 44.460234], - [11.298449, 44.463196], + [11.30424, 44.459545], + [11.30069, 44.461675], + [11.297369, 44.463985], [11.294294, 44.466464], - [11.290608, 44.470006], - [11.287425, 44.47379], + [11.291484, 44.469097], + [11.288952, 44.47187], + [11.286712, 44.474769], [11.284777, 44.477777], - [11.28269, 44.481931], - [11.281182, 44.486211], + [11.283158, 44.480879], + [11.281862, 44.484058], + [11.280898, 44.487296], [11.28027, 44.490575], - [11.279962, 44.494983], - [11.28026, 44.49939], + [11.279982, 44.493879], + [11.280035, 44.497189], + [11.28043, 44.500487], [11.281164, 44.503756], - [11.282663, 44.508037], - [11.284743, 44.512193], + [11.282233, 44.506977], + [11.283631, 44.510133], + [11.285352, 44.513208], [11.287385, 44.516183], - [11.290563, 44.51997], - [11.294247, 44.523516], + [11.28972, 44.519044], + [11.292344, 44.521775], + [11.295243, 44.524361], [11.298401, 44.526787], [11.343, 44.495] ] diff --git a/packages/turf-sector/test/out/sector4.geojson b/packages/turf-sector/test/out/sector4.geojson index 9ca84fec66..f6d0f1fa79 100644 --- a/packages/turf-sector/test/out/sector4.geojson +++ b/packages/turf-sector/test/out/sector4.geojson @@ -28,12 +28,69 @@ [ [11.343, 44.495], [11.294686, 44.523893], - [11.29889, 44.527132], - [11.303519, 44.530062], - [11.308529, 44.532653], - [11.313872, 44.534882], - [11.319496, 44.536726], - [11.325347, 44.538168], + [11.295075, 44.524221], + [11.295468, 44.524546], + [11.295866, 44.524868], + [11.296267, 44.525188], + [11.296674, 44.525505], + [11.297084, 44.525819], + [11.297499, 44.52613], + [11.297917, 44.526438], + [11.29834, 44.526744], + [11.298767, 44.527046], + [11.299198, 44.527346], + [11.299633, 44.527643], + [11.300072, 44.527937], + [11.300515, 44.528227], + [11.300961, 44.528515], + [11.301412, 44.5288], + [11.301866, 44.529081], + [11.302324, 44.52936], + [11.302786, 44.529635], + [11.303251, 44.529907], + [11.303721, 44.530176], + [11.304193, 44.530442], + [11.304669, 44.530705], + [11.305149, 44.530964], + [11.305632, 44.53122], + [11.306119, 44.531473], + [11.306609, 44.531722], + [11.307102, 44.531969], + [11.307599, 44.532211], + [11.308098, 44.532451], + [11.308601, 44.532686], + [11.309107, 44.532919], + [11.309617, 44.533148], + [11.310129, 44.533374], + [11.310644, 44.533596], + [11.311162, 44.533814], + [11.311683, 44.534029], + [11.312207, 44.534241], + [11.312734, 44.534448], + [11.313264, 44.534653], + [11.313796, 44.534853], + [11.314331, 44.53505], + [11.314868, 44.535244], + [11.315408, 44.535433], + [11.315951, 44.535619], + [11.316496, 44.535802], + [11.317044, 44.53598], + [11.317594, 44.536155], + [11.318146, 44.536326], + [11.3187, 44.536494], + [11.319257, 44.536657], + [11.319816, 44.536817], + [11.320377, 44.536973], + [11.32094, 44.537125], + [11.321505, 44.537273], + [11.322072, 44.537418], + [11.322641, 44.537558], + [11.323212, 44.537695], + [11.323784, 44.537828], + [11.324358, 44.537956], + [11.324934, 44.538081], + [11.325512, 44.538202], + [11.326091, 44.53832], [11.326672, 44.538433], [11.343, 44.495] ] diff --git a/packages/turf-sector/test/out/sector5.geojson b/packages/turf-sector/test/out/sector5.geojson index 4a5ba66d56..9f45dc8c30 100644 --- a/packages/turf-sector/test/out/sector5.geojson +++ b/packages/turf-sector/test/out/sector5.geojson @@ -28,63 +28,69 @@ [ [11.343, 44.495], [11.326672, 44.538433], - [11.332724, 44.539365], - [11.338874, 44.53987], - [11.345064, 44.539942], - [11.351234, 44.539581], - [11.357325, 44.53879], - [11.363278, 44.537578], - [11.369035, 44.535955], - [11.37454, 44.533937], - [11.379741, 44.531545], - [11.384588, 44.5288], - [11.389034, 44.525729], - [11.393035, 44.522363], - [11.396554, 44.518733], - [11.399557, 44.514874], - [11.402014, 44.510824], - [11.403903, 44.506622], - [11.405204, 44.502308], - [11.405907, 44.497924], - [11.406003, 44.493511], - [11.405493, 44.489114], - [11.404381, 44.484773], - [11.402678, 44.480531], - [11.400401, 44.476428], - [11.397572, 44.472504], - [11.394218, 44.468797], - [11.390371, 44.465342], - [11.386068, 44.462173], - [11.381352, 44.45932], - [11.376267, 44.45681], - [11.370862, 44.454668], - [11.365189, 44.452914], - [11.359303, 44.451565], - [11.353261, 44.450634], - [11.34712, 44.45013], - [11.340939, 44.450058], - [11.334778, 44.450418], - [11.328696, 44.451208], - [11.322752, 44.452419], - [11.317002, 44.454039], - [11.311502, 44.456054], - [11.306305, 44.458444], - [11.30146, 44.461185], - [11.297015, 44.464252], - [11.293012, 44.467616], - [11.289489, 44.471242], - [11.286482, 44.475098], - [11.284018, 44.479146], - [11.282122, 44.483346], - [11.280811, 44.487658], - [11.2801, 44.492042], - [11.279994, 44.496454], - [11.280495, 44.500852], - [11.281598, 44.505194], - [11.283292, 44.509438], - [11.285562, 44.513543], - [11.288386, 44.51747], - [11.291736, 44.52118], + [11.33213, 44.539293], + [11.337673, 44.539805], + [11.343258, 44.539966], + [11.348841, 44.539773], + [11.354378, 44.539228], + [11.359826, 44.538336], + [11.365141, 44.537103], + [11.370282, 44.53554], + [11.375208, 44.533658], + [11.379881, 44.531473], + [11.384264, 44.529001], + [11.388323, 44.526262], + [11.392025, 44.523278], + [11.395341, 44.520072], + [11.398247, 44.516669], + [11.400718, 44.513095], + [11.402735, 44.50938], + [11.404284, 44.505552], + [11.405351, 44.501642], + [11.405928, 44.497679], + [11.406011, 44.493695], + [11.4056, 44.489722], + [11.404697, 44.48579], + [11.40331, 44.481931], + [11.401451, 44.478175], + [11.399132, 44.47455], + [11.396374, 44.471086], + [11.393197, 44.46781], + [11.389626, 44.464748], + [11.385691, 44.461923], + [11.38142, 44.459357], + [11.376848, 44.457071], + [11.372012, 44.455083], + [11.366948, 44.453408], + [11.361696, 44.452059], + [11.356298, 44.451047], + [11.350796, 44.450379], + [11.345233, 44.450062], + [11.339652, 44.450097], + [11.334097, 44.450485], + [11.328613, 44.451222], + [11.32324, 44.452302], + [11.318023, 44.453717], + [11.313001, 44.455456], + [11.308215, 44.457505], + [11.303701, 44.459848], + [11.299495, 44.462468], + [11.295629, 44.465342], + [11.292135, 44.468449], + [11.28904, 44.471765], + [11.286368, 44.475263], + [11.28414, 44.478916], + [11.282374, 44.482696], + [11.281083, 44.486572], + [11.280278, 44.490514], + [11.279966, 44.494492], + [11.280148, 44.498474], + [11.280824, 44.502429], + [11.281988, 44.506325], + [11.283631, 44.510133], + [11.285741, 44.513822], + [11.2883, 44.517364], + [11.29129, 44.52073], [11.294686, 44.523893], [11.343, 44.495] ] diff --git a/packages/turf-sector/test/out/sector6.geojson b/packages/turf-sector/test/out/sector6.geojson index 1037e5ea9d..bdaab18437 100644 --- a/packages/turf-sector/test/out/sector6.geojson +++ b/packages/turf-sector/test/out/sector6.geojson @@ -28,61 +28,68 @@ [ [11.343, 44.495], [11.397614, 44.51747], - [11.400438, 44.513543], - [11.402708, 44.509438], - [11.404402, 44.505194], - [11.405505, 44.500852], - [11.406006, 44.496454], - [11.4059, 44.492042], - [11.405189, 44.487658], + [11.400151, 44.513989], + [11.402252, 44.510364], + [11.403903, 44.506622], + [11.405089, 44.502791], + [11.405803, 44.498902], + [11.406038, 44.494983], + [11.405794, 44.491064], + [11.405072, 44.487175], [11.403878, 44.483346], - [11.401982, 44.479146], - [11.399518, 44.475098], - [11.396511, 44.471242], - [11.392988, 44.467616], - [11.388985, 44.464252], - [11.38454, 44.461185], - [11.379695, 44.458444], + [11.402221, 44.479605], + [11.400114, 44.475982], + [11.397572, 44.472504], + [11.394615, 44.469197], + [11.391266, 44.466086], + [11.387551, 44.463196], + [11.383496, 44.460547], + [11.379135, 44.45816], [11.374498, 44.456054], - [11.368998, 44.454039], - [11.363248, 44.452419], - [11.357304, 44.451208], - [11.351222, 44.450418], - [11.345061, 44.450058], - [11.33888, 44.45013], - [11.332739, 44.450634], + [11.369623, 44.454244], + [11.364545, 44.452744], + [11.359303, 44.451565], + [11.353938, 44.450717], + [11.34849, 44.450205], + [11.343, 44.450034], + [11.33751, 44.450205], + [11.332062, 44.450717], [11.326697, 44.451565], - [11.320811, 44.452914], - [11.315138, 44.454668], - [11.309733, 44.45681], - [11.304648, 44.45932], - [11.299932, 44.462173], - [11.295629, 44.465342], - [11.291782, 44.468797], + [11.321455, 44.452744], + [11.316377, 44.454244], + [11.311502, 44.456054], + [11.306865, 44.45816], + [11.302504, 44.460547], + [11.298449, 44.463196], + [11.294734, 44.466086], + [11.291385, 44.469197], [11.288428, 44.472504], - [11.285599, 44.476428], - [11.283322, 44.480531], - [11.281619, 44.484773], - [11.280507, 44.489114], - [11.279997, 44.493511], - [11.280093, 44.497924], - [11.280796, 44.502308], + [11.285886, 44.475982], + [11.283779, 44.479605], + [11.282122, 44.483346], + [11.280928, 44.487175], + [11.280206, 44.491064], + [11.279962, 44.494983], + [11.280197, 44.498902], + [11.280911, 44.502791], [11.282097, 44.506622], - [11.283986, 44.510824], - [11.286443, 44.514874], - [11.289446, 44.518733], - [11.292965, 44.522363], - [11.296966, 44.525729], - [11.301412, 44.5288], - [11.306259, 44.531545], + [11.283748, 44.510364], + [11.285849, 44.513989], + [11.288386, 44.51747], + [11.291339, 44.52078], + [11.294686, 44.523893], + [11.298401, 44.526787], + [11.302456, 44.529439], + [11.30682, 44.531828], [11.31146, 44.533937], - [11.316965, 44.535955], - [11.322722, 44.537578], - [11.328675, 44.53879], - [11.334766, 44.539581], - [11.340936, 44.539942], - [11.347126, 44.53987], - [11.353276, 44.539365], + [11.31634, 44.53575], + [11.321424, 44.537252], + [11.326672, 44.538433], + [11.332045, 44.539282], + [11.337502, 44.539795], + [11.343, 44.539966], + [11.348498, 44.539795], + [11.353955, 44.539282], [11.359328, 44.538433], [11.364576, 44.537252], [11.343, 44.495]