[Git][debian-gis-team/antimeridian][upstream] New upstream version 0.3.8

Antonio Valentino (@antonio.valentino) gitlab at salsa.debian.org
Sat Jul 13 09:35:08 BST 2024



Antonio Valentino pushed to branch upstream at Debian GIS Project / antimeridian


Commits:
cc9c82c3 by Antonio Valentino at 2024-07-13T08:26:19+00:00
New upstream version 0.3.8
- - - - -


7 changed files:

- .pre-commit-config.yaml
- CHANGELOG.md
- pyproject.toml
- src/antimeridian/_implementation.py
- + tests/data/input/issues-124.json
- + tests/data/output/issues-124.json
- tests/test_polygon.py


Changes:

=====================================
.pre-commit-config.yaml
=====================================
@@ -7,14 +7,14 @@ repos:
       - id: check-yaml
       - id: check-added-large-files
   - repo: https://github.com/pre-commit/mirrors-mypy
-    rev: v1.10.0
+    rev: v1.10.1
     hooks:
       - id: mypy
         additional_dependencies:
           - click~=8.1.6
           - pytest~=8.0
   - repo: https://github.com/charliermarsh/ruff-pre-commit
-    rev: v0.4.9
+    rev: v0.5.1
     hooks:
       - id: ruff
         types_or: [python, pyi, jupyter]


=====================================
CHANGELOG.md
=====================================
@@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
 
 ## [Unreleased]
 
+## [0.3.8] - 2024-07-11
+
+### Fixed
+
+- Forcing the north or the south pole wasn't working in some cases ([#125](https://github.com/gadomski/antimeridian/pull/125))
+
 ## [0.3.7] - 2024-06-20
 
 ### Fixed
@@ -140,7 +146,8 @@ This v0.1.0 release is to indicate that we think that this package is ready to u
 
 Initial release.
 
-[unreleased]: https://github.com/gadomski/antimeridian/compare/v0.3.7...HEAD
+[unreleased]: https://github.com/gadomski/antimeridian/compare/v0.3.8...HEAD
+[0.3.8]: https://github.com/gadomsk/antimeridian/compare/v0.3.7...v0.3.8
 [0.3.7]: https://github.com/gadomsk/antimeridian/compare/v0.3.6...v0.3.7
 [0.3.6]: https://github.com/gadomsk/antimeridian/compare/v0.3.5...v0.3.6
 [0.3.5]: https://github.com/gadomsk/antimeridian/compare/v0.3.4...v0.3.5


=====================================
pyproject.toml
=====================================
@@ -1,6 +1,6 @@
 [project]
 name = "antimeridian"
-version = "0.3.7"
+version = "0.3.8"
 authors = [{ name = "Pete Gadomski", email = "pete.gadomski at gmail.com" }]
 description = "Fix GeoJSON geometries that cross the antimeridian"
 readme = "README.md"
@@ -31,7 +31,7 @@ dev = [
     "pre-commit~=3.2",
     "pytest~=8.0",
     "pytest-console-scripts~=1.4",
-    "ruff~=0.4.2",
+    "ruff~=0.5.0",
     "tomli~=2.0; python_version<'3.11'",
     "typing_extensions; python_version<'3.10'",
 ]


=====================================
src/antimeridian/_implementation.py
=====================================
@@ -10,6 +10,7 @@ from __future__ import annotations
 
 import copy
 import warnings
+from collections import namedtuple
 from typing import Any, Dict, List, Optional, Protocol, Tuple, Union, cast
 
 import numpy
@@ -510,6 +511,9 @@ def crossing_latitude(start: XY, end: XY) -> float:
         )
 
 
+IndexAndLatitude = namedtuple("IndexAndLatitude", "index latitude")
+
+
 def extend_over_poles(
     segments: List[List[XY]],
     *,
@@ -517,38 +521,65 @@ def extend_over_poles(
     force_south_pole: bool,
     fix_winding: bool,
 ) -> List[List[XY]]:
-    left_starts = list()
-    right_starts = list()
-    left_ends = list()
-    right_ends = list()
+    left_start = None
+    right_start = None
+    left_end = None
+    right_end = None
     for i, segment in enumerate(segments):
-        if segment[0][0] == -180:
-            left_starts.append((i, segment[0][1]))
-        else:
-            right_starts.append((i, segment[0][1]))
-        if segment[-1][0] == -180:
-            left_ends.append((i, segment[-1][1]))
-        else:
-            right_ends.append((i, segment[-1][1]))
-    left_ends.sort(key=lambda v: v[1])
-    left_starts.sort(key=lambda v: v[1])
-    right_ends.sort(key=lambda v: v[1], reverse=True)
-    right_starts.sort(key=lambda v: v[1], reverse=True)
+        if segment[0][0] == -180 and (
+            left_start is None or segment[0][1] < left_start.latitude
+        ):
+            left_start = IndexAndLatitude(i, segment[0][1])
+        elif segment[0][0] == 180 and (
+            right_start is None or segment[0][1] > right_start.latitude
+        ):
+            right_start = IndexAndLatitude(i, segment[0][1])
+        if segment[-1][0] == -180 and (
+            left_end is None or segment[-1][1] < left_end.latitude
+        ):
+            left_end = IndexAndLatitude(i, segment[-1][1])
+        elif segment[-1][0] == 180 and (
+            right_end is None or segment[-1][1] > right_end.latitude
+        ):
+            right_end = IndexAndLatitude(i, segment[-1][1])
+
     is_over_north_pole = False
     is_over_south_pole = False
     original_segments = copy.deepcopy(segments)
+
     # If there's no segment ends between a start and the pole, extend the
     # segment over the pole.
-    if left_ends and (
-        force_south_pole or not left_starts or left_ends[0][1] < left_starts[0][1]
-    ):
-        is_over_south_pole = True
-        segments[left_ends[0][0]] += [(-180, -90), (180, -90)]
-    if right_ends and (
-        force_north_pole or not right_starts or right_ends[0][1] > right_starts[0][1]
-    ):
-        is_over_north_pole = True
-        segments[right_ends[0][0]] += [(180, 90), (-180, 90)]
+    if left_end:
+        if (
+            (force_north_pole and not force_south_pole)
+            and not right_end  # Total hack to skip the force if we're going to
+            # add points later from the right side
+            and (not left_start or left_end.latitude > left_start.latitude)
+        ):
+            is_over_north_pole = True
+            segments[left_end.index] += [(-180, 90), (180, 90)]
+            segments[left_end.index].reverse()
+        elif (
+            force_south_pole
+            or not left_start
+            or left_end.latitude < left_start.latitude
+        ):
+            is_over_south_pole = True
+            segments[left_end.index] += [(-180, -90), (180, -90)]
+    if right_end:
+        if (force_south_pole and not force_north_pole) and (
+            not right_start or right_end.latitude < right_start.latitude
+        ):
+            is_over_south_pole = True
+            segments[right_end.index] += [(180, -90), (-180, -90)]
+            segments[right_end.index].reverse()
+        elif (
+            force_north_pole
+            or not right_start
+            or right_end.latitude > right_start.latitude
+        ):
+            is_over_north_pole = True
+            segments[right_end.index] += [(180, 90), (-180, 90)]
     if fix_winding and is_over_north_pole and is_over_south_pole:
         # These assertions are here because we're assuming that we set
         # `fix_winding` to `False` up in `fix_polygon` if either of the


=====================================
tests/data/input/issues-124.json
=====================================
@@ -0,0 +1,811 @@
+{
+    "type": "Polygon",
+    "coordinates": [
+        [
+            [
+                123.901846,
+                -29.596765
+            ],
+            [
+                125.905655,
+                -29.482468
+            ],
+            [
+                127.90284,
+                -29.33837
+            ],
+            [
+                129.892531,
+                -29.164777
+            ],
+            [
+                131.873905,
+                -28.962029
+            ],
+            [
+                133.846196,
+                -28.730497
+            ],
+            [
+                135.808693,
+                -28.470586
+            ],
+            [
+                137.760745,
+                -28.182725
+            ],
+            [
+                139.701766,
+                -27.867371
+            ],
+            [
+                141.631233,
+                -27.525003
+            ],
+            [
+                143.548689,
+                -27.156122
+            ],
+            [
+                145.453744,
+                -26.761247
+            ],
+            [
+                147.346071,
+                -26.340915
+            ],
+            [
+                149.225413,
+                -25.895676
+            ],
+            [
+                151.091573,
+                -25.426095
+            ],
+            [
+                152.94442,
+                -24.932748
+            ],
+            [
+                154.783882,
+                -24.416219
+            ],
+            [
+                156.609948,
+                -23.877103
+            ],
+            [
+                158.42266,
+                -23.316001
+            ],
+            [
+                160.222119,
+                -22.733521
+            ],
+            [
+                162.008472,
+                -22.130275
+            ],
+            [
+                163.781918,
+                -21.506881
+            ],
+            [
+                165.5427,
+                -20.863961
+            ],
+            [
+                167.291103,
+                -20.202141
+            ],
+            [
+                169.027453,
+                -19.52205
+            ],
+            [
+                170.752112,
+                -18.824321
+            ],
+            [
+                172.465476,
+                -18.10959
+            ],
+            [
+                174.167973,
+                -17.378496
+            ],
+            [
+                175.860059,
+                -16.631684
+            ],
+            [
+                177.542215,
+                -15.869801
+            ],
+            [
+                179.214949,
+                -15.093498
+            ],
+            [
+                -179.121213,
+                -14.303433
+            ],
+            [
+                -177.465723,
+                -13.500268
+            ],
+            [
+                -175.818017,
+                -12.68467
+            ],
+            [
+                -174.177514,
+                -11.857314
+            ],
+            [
+                -172.543622,
+                -11.01888
+            ],
+            [
+                -170.915733,
+                -10.170058
+            ],
+            [
+                -169.293233,
+                -9.311543
+            ],
+            [
+                -167.675494,
+                -8.44404
+            ],
+            [
+                -166.061883,
+                -7.568263
+            ],
+            [
+                -164.451761,
+                -6.684935
+            ],
+            [
+                -162.844481,
+                -5.794788
+            ],
+            [
+                -161.239394,
+                -4.898567
+            ],
+            [
+                -159.635847,
+                -3.997022
+            ],
+            [
+                -158.033185,
+                -3.09092
+            ],
+            [
+                -156.430751,
+                -2.181032
+            ],
+            [
+                -154.827888,
+                -1.268146
+            ],
+            [
+                -153.223941,
+                -0.353057
+            ],
+            [
+                -151.618256,
+                0.563429
+            ],
+            [
+                -150.010182,
+                1.480493
+            ],
+            [
+                -148.39907,
+                2.39731
+            ],
+            [
+                -146.784279,
+                3.313042
+            ],
+            [
+                -145.165171,
+                4.226841
+            ],
+            [
+                -143.541118,
+                5.137852
+            ],
+            [
+                -141.911499,
+                6.045211
+            ],
+            [
+                -140.275702,
+                6.948045
+            ],
+            [
+                -138.633128,
+                7.845477
+            ],
+            [
+                -136.98319,
+                8.736619
+            ],
+            [
+                -135.325315,
+                9.620583
+            ],
+            [
+                -133.658947,
+                10.496472
+            ],
+            [
+                -131.983548,
+                11.363389
+            ],
+            [
+                -130.298601,
+                12.220432
+            ],
+            [
+                -128.603608,
+                13.066701
+            ],
+            [
+                -126.898101,
+                13.901294
+            ],
+            [
+                -125.181634,
+                14.723309
+            ],
+            [
+                -123.453794,
+                15.531851
+            ],
+            [
+                -121.714197,
+                16.326024
+            ],
+            [
+                -119.962496,
+                17.104942
+            ],
+            [
+                -118.198382,
+                17.867724
+            ],
+            [
+                -116.421584,
+                18.613496
+            ],
+            [
+                -114.631877,
+                19.341398
+            ],
+            [
+                -112.82908,
+                20.050579
+            ],
+            [
+                -111.013063,
+                20.740203
+            ],
+            [
+                -109.183745,
+                21.409449
+            ],
+            [
+                -107.341102,
+                22.057513
+            ],
+            [
+                -105.485167,
+                22.683612
+            ],
+            [
+                -103.61603,
+                23.286982
+            ],
+            [
+                -101.733844,
+                23.866882
+            ],
+            [
+                -99.838825,
+                24.422599
+            ],
+            [
+                -97.931251,
+                24.953444
+            ],
+            [
+                -96.011468,
+                25.458758
+            ],
+            [
+                -94.079886,
+                25.937915
+            ],
+            [
+                -92.136981,
+                26.390319
+            ],
+            [
+                -90.183293,
+                26.815412
+            ],
+            [
+                -88.219426,
+                27.212671
+            ],
+            [
+                -86.246047,
+                27.581612
+            ],
+            [
+                -84.263878,
+                27.921791
+            ],
+            [
+                -82.273701,
+                28.232809
+            ],
+            [
+                -80.276348,
+                28.514305
+            ],
+            [
+                -78.272698,
+                28.765967
+            ],
+            [
+                -76.263673,
+                28.987525
+            ],
+            [
+                -74.25023,
+                29.178759
+            ],
+            [
+                -72.233359,
+                29.339491
+            ],
+            [
+                -70.214071,
+                29.469595
+            ],
+            [
+                -68.193396,
+                29.568988
+            ],
+            [
+                -66.172372,
+                29.637637
+            ],
+            [
+                -64.152041,
+                29.675554
+            ],
+            [
+                -62.13344,
+                29.682796
+            ],
+            [
+                -60.117593,
+                29.659465
+            ],
+            [
+                -58.105504,
+                29.605708
+            ],
+            [
+                -56.098154,
+                29.521712
+            ],
+            [
+                -54.096489,
+                29.407707
+            ],
+            [
+                -52.101418,
+                29.263957
+            ],
+            [
+                -50.113805,
+                29.090767
+            ],
+            [
+                -48.134465,
+                28.888475
+            ],
+            [
+                -46.164162,
+                28.657449
+            ],
+            [
+                -44.203601,
+                28.398091
+            ],
+            [
+                -42.253427,
+                28.110828
+            ],
+            [
+                -40.314224,
+                27.796113
+            ],
+            [
+                -38.386512,
+                27.454422
+            ],
+            [
+                -36.470745,
+                27.086251
+            ],
+            [
+                -34.567312,
+                26.692118
+            ],
+            [
+                -32.676536,
+                26.272555
+            ],
+            [
+                -30.798677,
+                25.828108
+            ],
+            [
+                -28.933928,
+                25.359339
+            ],
+            [
+                -27.082423,
+                24.866819
+            ],
+            [
+                -25.244232,
+                24.35113
+            ],
+            [
+                -23.419371,
+                23.812863
+            ],
+            [
+                -21.607794,
+                23.252614
+            ],
+            [
+                -19.809407,
+                22.670989
+            ],
+            [
+                -18.024062,
+                22.068596
+            ],
+            [
+                -16.251564,
+                21.44605
+            ],
+            [
+                -14.491672,
+                20.803969
+            ],
+            [
+                -12.744103,
+                20.142976
+            ],
+            [
+                -11.008535,
+                19.463698
+            ],
+            [
+                -9.284608,
+                18.766764
+            ],
+            [
+                -7.571931,
+                18.052808
+            ],
+            [
+                -5.870077,
+                17.322467
+            ],
+            [
+                -4.178596,
+                16.576382
+            ],
+            [
+                -2.497007,
+                15.815198
+            ],
+            [
+                -0.824807,
+                15.039565
+            ],
+            [
+                0.838527,
+                14.250138
+            ],
+            [
+                2.49354,
+                13.447577
+            ],
+            [
+                4.140794,
+                12.632548
+            ],
+            [
+                5.780866,
+                11.805723
+            ],
+            [
+                7.414347,
+                10.967783
+            ],
+            [
+                9.041841,
+                10.119414
+            ],
+            [
+                10.663961,
+                9.261312
+            ],
+            [
+                12.281332,
+                8.394181
+            ],
+            [
+                13.894585,
+                7.518732
+            ],
+            [
+                15.50436,
+                6.635689
+            ],
+            [
+                17.1113,
+                5.745783
+            ],
+            [
+                18.716053,
+                4.849757
+            ],
+            [
+                20.319274,
+                3.948364
+            ],
+            [
+                21.921615,
+                3.042366
+            ],
+            [
+                23.523733,
+                2.132539
+            ],
+            [
+                25.126286,
+                1.219666
+            ],
+            [
+                26.729929,
+                0.304545
+            ],
+            [
+                28.335316,
+                -0.612019
+            ],
+            [
+                29.943101,
+                -1.529207
+            ],
+            [
+                31.553931,
+                -2.446193
+            ],
+            [
+                33.16845,
+                -3.362138
+            ],
+            [
+                34.787298,
+                -4.276195
+            ],
+            [
+                36.411104,
+                -5.187508
+            ],
+            [
+                38.040493,
+                -6.095211
+            ],
+            [
+                39.676077,
+                -6.998433
+            ],
+            [
+                41.318459,
+                -7.896293
+            ],
+            [
+                42.968228,
+                -8.787904
+            ],
+            [
+                44.62596,
+                -9.672376
+            ],
+            [
+                46.292214,
+                -10.548811
+            ],
+            [
+                47.967532,
+                -11.41631
+            ],
+            [
+                49.652434,
+                -12.273971
+            ],
+            [
+                51.34742,
+                -13.12089
+            ],
+            [
+                53.052964,
+                -13.956165
+            ],
+            [
+                54.769514,
+                -14.778892
+            ],
+            [
+                56.497488,
+                -15.588172
+            ],
+            [
+                58.237273,
+                -16.383109
+            ],
+            [
+                59.989218,
+                -17.162813
+            ],
+            [
+                61.753638,
+                -17.9264
+            ],
+            [
+                63.530807,
+                -18.672995
+            ],
+            [
+                65.320953,
+                -19.401734
+            ],
+            [
+                67.12426,
+                -20.111762
+            ],
+            [
+                68.940862,
+                -20.802242
+            ],
+            [
+                70.770841,
+                -21.472348
+            ],
+            [
+                72.614226,
+                -22.121273
+            ],
+            [
+                74.470984,
+                -22.748229
+            ],
+            [
+                76.341029,
+                -23.352451
+            ],
+            [
+                78.224208,
+                -23.933193
+            ],
+            [
+                80.120307,
+                -24.489736
+            ],
+            [
+                82.029047,
+                -25.021391
+            ],
+            [
+                83.950084,
+                -25.527493
+            ],
+            [
+                85.883006,
+                -26.007412
+            ],
+            [
+                87.827336,
+                -26.460549
+            ],
+            [
+                89.782534,
+                -26.886341
+            ],
+            [
+                91.747992,
+                -27.284263
+            ],
+            [
+                93.723041,
+                -27.653826
+            ],
+            [
+                95.706955,
+                -27.994585
+            ],
+            [
+                97.698948,
+                -28.306134
+            ],
+            [
+                99.698183,
+                -28.588113
+            ],
+            [
+                101.703777,
+                -28.840204
+            ],
+            [
+                103.714801,
+                -29.062138
+            ],
+            [
+                105.730292,
+                -29.253689
+            ],
+            [
+                107.749255,
+                -29.414681
+            ],
+            [
+                109.770669,
+                -29.544984
+            ],
+            [
+                111.793499,
+                -29.644516
+            ],
+            [
+                113.816699,
+                -29.713241
+            ],
+            [
+                115.839219,
+                -29.751171
+            ],
+            [
+                117.860015,
+                -29.758364
+            ],
+            [
+                119.878056,
+                -29.734922
+            ],
+            [
+                121.892328,
+                -29.680993
+            ],
+            [
+                123.901846,
+                -29.596765
+            ]
+        ]
+    ]
+}


=====================================
tests/data/output/issues-124.json
=====================================
@@ -0,0 +1 @@
+{"type": "Polygon", "coordinates": [[[180.0, -14.698414], [179.214949, -15.093498], [177.542215, -15.869801], [175.86005899999998, -16.631684], [174.16797299999996, -17.378496], [172.46547599999997, -18.10959], [170.752112, -18.824321], [169.02745300000004, -19.52205], [167.29110300000002, -20.202141], [165.54269999999997, -20.863961], [163.78191800000002, -21.506881], [162.00847199999998, -22.130275], [160.22211900000002, -22.733521], [158.42266, -23.316001], [156.60994800000003, -23.877103], [154.783882, -24.416219], [152.94442000000004, -24.932748], [151.09157300000004, -25.426095], [149.225413, -25.895676], [147.346071, -26.340915], [145.45374400000003, -26.761247], [143.54868899999997, -27.156122], [141.631233, -27.525003], [139.70176600000002, -27.867371], [137.760745, -28.182725], [135.808693, -28.470586], [133.84619599999996, -28.730497], [131.87390500000004, -28.962029], [129.89253099999996, -29.164777], [127.90283999999997, -29.33837], [125.90565500000002, -29.482468], [123.90184599999998, -29.596765], [121.89232800000002, -29.680993], [119.87805600000002, -29.734922], [117.86001499999998, -29.758364], [115.83921900000001, -29.751171], [113.81669899999997, -29.713241], [111.793499, -29.644516], [109.770669, -29.544984], [107.749255, -29.414681], [105.73029200000002, -29.253689], [103.71480099999997, -29.062138], [101.703777, -28.840204], [99.69818299999997, -28.588113], [97.69894799999997, -28.306134], [95.706955, -27.994585], [93.72304099999997, -27.653826], [91.74799200000001, -27.284263], [89.782534, -26.886341], [87.827336, -26.460549], [85.88300600000002, -26.007412], [83.950084, -25.527493], [82.02904699999999, -25.021391], [80.12030700000003, -24.489736], [78.22420799999998, -23.933193], [76.34102899999999, -23.352451], [74.47098399999999, -22.748229], [72.614226, -22.121273], [70.77084100000002, -21.472348], [68.94086199999998, -20.802242], [67.12425999999999, -20.111762], [65.320953, -19.401734], [63.53080700000001, -18.672995], [61.753637999999995, -17.9264], [59.989217999999994, -17.162813], [58.237273000000016, -16.383109], [56.497488000000004, -15.588172], [54.769514000000015, -14.778892], [53.052964, -13.956165], [51.34742, -13.12089], [49.652434, -12.273971], [47.967532000000006, -11.41631], [46.292214, -10.548811], [44.62595999999999, -9.672376], [42.96822800000001, -8.787904], [41.31845899999999, -7.896293], [39.67607699999999, -6.998433], [38.040493, -6.095211], [36.411103999999995, -5.187508], [34.78729799999999, -4.276195], [33.16845000000001, -3.362138], [31.553931000000006, -2.446193], [29.943101000000013, -1.529207], [28.335316000000006, -0.612019], [26.729929, 0.304545], [25.126285999999993, 1.219666], [23.523732999999993, 2.132539], [21.921615000000003, 3.042366], [20.319274000000007, 3.948364], [18.716052999999988, 4.849757], [17.1113, 5.745783], [15.504359999999991, 6.635689], [13.894585000000006, 7.518732], [12.281331999999992, 8.394181], [10.663961, 9.261312], [9.041841000000005, 10.119414], [7.414346999999992, 10.967783], [5.780866000000003, 11.805723], [4.140794, 12.632548], [2.493539999999996, 13.447577], [0.8385269999999991, 14.250138], [-0.8248069999999927, 15.039565], [-2.4970069999999964, 15.815198], [-4.178595999999999, 16.576382], [-5.870077000000009, 17.322467], [-7.571931000000006, 18.052808], [-9.284607999999992, 18.766764], [-11.008534999999995, 19.463698], [-12.744102999999996, 20.142976], [-14.491671999999994, 20.803969], [-16.251564000000002, 21.44605], [-18.024062000000015, 22.068596], [-19.809406999999993, 22.670989], [-21.607794000000013, 23.252614], [-23.419371000000012, 23.812863], [-25.24423200000001, 24.35113], [-27.082423000000006, 24.866819], [-28.93392800000001, 25.359339], [-30.798676999999998, 25.828108], [-32.676536, 26.272555], [-34.567312000000015, 26.692118], [-36.470744999999994, 27.086251], [-38.38651200000001, 27.454422], [-40.314223999999996, 27.796113], [-42.25342699999999, 28.110828], [-44.20360099999999, 28.398091], [-46.164162000000005, 28.657449], [-48.134465000000006, 28.888475], [-50.11380500000001, 29.090767], [-52.101417999999995, 29.263957], [-54.09648899999999, 29.407707], [-56.098153999999994, 29.521712], [-58.105503999999996, 29.605708], [-60.117593, 29.659465], [-62.13344000000001, 29.682796], [-64.152041, 29.675554], [-66.172372, 29.637637], [-68.193396, 29.568988], [-70.214071, 29.469595], [-72.233359, 29.339491], [-74.25023, 29.178759], [-76.263673, 28.987525], [-78.272698, 28.765967], [-80.276348, 28.514305], [-82.273701, 28.232809], [-84.263878, 27.921791], [-86.246047, 27.581612], [-88.219426, 27.212671], [-90.183293, 26.815412], [-92.136981, 26.390319], [-94.079886, 25.937915], [-96.011468, 25.458758], [-97.931251, 24.953444], [-99.838825, 24.422599], [-101.733844, 23.866882], [-103.61603, 23.286982], [-105.485167, 22.683612], [-107.341102, 22.057513], [-109.183745, 21.409449], [-111.013063, 20.740203], [-112.82908, 20.050579], [-114.631877, 19.341398], [-116.421584, 18.613496], [-118.198382, 17.867724], [-119.962496, 17.104942], [-121.714197, 16.326024], [-123.453794, 15.531851], [-125.181634, 14.723309], [-126.898101, 13.901294], [-128.603608, 13.066701], [-130.298601, 12.220432], [-131.983548, 11.363389], [-133.658947, 10.496472], [-135.325315, 9.620583], [-136.98319, 8.736619], [-138.633128, 7.845477], [-140.275702, 6.948045], [-141.911499, 6.045211], [-143.541118, 5.137852], [-145.165171, 4.226841], [-146.784279, 3.313042], [-148.39907, 2.39731], [-150.010182, 1.480493], [-151.618256, 0.563429], [-153.223941, -0.353057], [-154.827888, -1.268146], [-156.430751, -2.181032], [-158.033185, -3.09092], [-159.635847, -3.997022], [-161.239394, -4.898567], [-162.844481, -5.794788], [-164.451761, -6.684935], [-166.061883, -7.568263], [-167.675494, -8.44404], [-169.293233, -9.311543], [-170.915733, -10.170058], [-172.543622, -11.01888], [-174.177514, -11.857314], [-175.818017, -12.68467], [-177.465723, -13.500268], [-179.121213, -14.303433], [-180.0, -14.698414], [-180.0, -90.0], [180.0, -90.0], [180.0, -14.698414]]]}


=====================================
tests/test_polygon.py
=====================================
@@ -164,3 +164,11 @@ def test_z_coordinates() -> None:
     polygon = Polygon([[0, 0, 1], [10, 0, 2], [10, 10, 3], [0, 10, 4]])
     fixed = antimeridian.fix_polygon(polygon)
     assert fixed.has_z
+
+
+def test_force_south_pole(read_input: Reader, read_output: Reader) -> None:
+    # https://github.com/gadomski/antimeridian/issues/124
+    input = read_input("issues-124")
+    output = read_output("issues-124")
+    fixed = antimeridian.fix_polygon(input, force_south_pole=True)
+    assert fixed.normalize() == output.normalize()



View it on GitLab: https://salsa.debian.org/debian-gis-team/antimeridian/-/commit/cc9c82c3c45e2d759bd7a84fa31777d968981b75

-- 
This project does not include diff previews in email notifications.
View it on GitLab: https://salsa.debian.org/debian-gis-team/antimeridian/-/commit/cc9c82c3c45e2d759bd7a84fa31777d968981b75
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20240713/7f891aed/attachment-0001.htm>


More information about the Pkg-grass-devel mailing list