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

Antonio Valentino (@antonio.valentino) gitlab at salsa.debian.org
Sun Apr 13 09:53:35 BST 2025



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


Commits:
5a6d670e by Antonio Valentino at 2025-04-13T08:45:32+00:00
New upstream version 0.4.1
- - - - -


12 changed files:

- .github/workflows/ci.yaml
- .github/workflows/docs.yaml
- .pre-commit-config.yaml
- CHANGELOG.md
- pyproject.toml
- src/antimeridian/_cli.py
- src/antimeridian/_implementation.py
- + tests/data/input/issues-164.json
- + tests/data/output/flat/issues-164.json
- + tests/data/output/spherical/issues-164.json
- tests/test_geojson.py
- uv.lock


Changes:

=====================================
.github/workflows/ci.yaml
=====================================
@@ -26,7 +26,7 @@ jobs:
       - uses: actions/setup-python at v5
         with:
           python-version: ${{ matrix.python-version }}
-      - uses: astral-sh/setup-uv at v4
+      - uses: astral-sh/setup-uv at v5
       - name: Sync
         run: uv sync
       - name: pre-commit
@@ -43,7 +43,7 @@ jobs:
         uses: actions/setup-python at v5
         with:
           python-version: "3.10"
-      - uses: astral-sh/setup-uv at v4
+      - uses: astral-sh/setup-uv at v5
       - name: Sync
         run: uv sync --resolution lowest-direct
       - name: pytest


=====================================
.github/workflows/docs.yaml
=====================================
@@ -22,7 +22,7 @@ jobs:
       - uses: actions/checkout at v4
         with:
           fetch-depth: 0
-      - uses: astral-sh/setup-uv at v4
+      - uses: astral-sh/setup-uv at v5
       - name: Sync
         run: uv sync
       - name: Deploy


=====================================
.pre-commit-config.yaml
=====================================
@@ -6,14 +6,14 @@ repos:
       - id: end-of-file-fixer
       - id: check-yaml
   - repo: https://github.com/pre-commit/mirrors-mypy
-    rev: v1.13.0
+    rev: v1.15.0
     hooks:
       - id: mypy
         additional_dependencies:
           - click~=8.1.6
           - pytest>=8.0
   - repo: https://github.com/charliermarsh/ruff-pre-commit
-    rev: v0.8.3
+    rev: v0.11.4
     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.4.1] - 2025-04-10
+
+### Added
+
+- Reverse argument ([#167](https://github.com/gadomski/antimeridian/pull/167))
+
 ## [0.4.0] - 2024-12-17
 
 ### Added
@@ -181,7 +187,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.4.0...HEAD
+[unreleased]: https://github.com/gadomski/antimeridian/compare/v0.4.1...HEAD
+[0.4.1]: https://github.com/gadomsk/antimeridian/compare/v0.4.0...v0.4.1
 [0.4.0]: https://github.com/gadomsk/antimeridian/compare/v0.3.12...v0.4.0
 [0.3.12]: https://github.com/gadomsk/antimeridian/compare/v0.3.11...v0.3.12
 [0.3.11]: https://github.com/gadomsk/antimeridian/compare/v0.3.10...v0.3.11


=====================================
pyproject.toml
=====================================
@@ -1,6 +1,6 @@
 [project]
 name = "antimeridian"
-version = "0.4.0"
+version = "0.4.1"
 authors = [{ name = "Pete Gadomski", email = "pete.gadomski at gmail.com" }]
 description = "Correct GeoJSON geometries that cross the 180th meridian"
 readme = "README.md"
@@ -29,6 +29,25 @@ cli = ["click>=8.1.6"]
 [project.scripts]
 antimeridian = "antimeridian._cli:cli"
 
+[dependency-groups]
+dev = [
+    "cartopy>=0.24.1",
+    "matplotlib>=3.9.2",
+    "mike>=2.1.3",
+    "mkdocs-click>=0.8.1",
+    "mkdocs-jupyter>=0.25.1",
+    "mkdocs-material[imaging]>=9.5.47",
+    "mkdocstrings[python]>=0.27.0",
+    "mypy>=1.2",
+    "packaging>=24.0",
+    "pre-commit>=4.0",
+    "pytest-console-scripts>=1.4",
+    "pytest>=8.0",
+    "ruff>=0.6.1",
+    "scipy>=1.14.1",
+    "shapely>=2.0.6",
+]
+
 [tool.mypy]
 strict = true
 
@@ -47,25 +66,6 @@ filterwarnings = ["error"]
 [tool.ruff]
 lint.select = ["F", "E", "W", "I", "ERA", "RUF"]
 
-[tool.uv]
-dev-dependencies = [
-    "cartopy>=0.24.1",
-    "matplotlib>=3.9.2",
-    "mike>=2.1.3",
-    "mkdocs-click>=0.8.1",
-    "mkdocs-jupyter>=0.25.1",
-    "mkdocs-material[imaging]>=9.5.47",
-    "mkdocstrings[python]>=0.27.0",
-    "mypy>=1.2",
-    "packaging>=24.0",
-    "pre-commit>=4.0",
-    "pytest-console-scripts>=1.4",
-    "pytest>=8.0",
-    "ruff>=0.6.1",
-    "scipy>=1.14.1",
-    "shapely>=2.0.6",
-]
-
 [build-system]
 requires = ["hatchling"]
 build-backend = "hatchling.build"


=====================================
src/antimeridian/_cli.py
=====================================
@@ -59,12 +59,20 @@ def cli() -> None:
     default=True,
     help="Compute meridian crossings on the sphere rather than using 2D geometry",
 )
+ at click.option(
+    "--reverse",
+    show_default=True,
+    default=False,
+    is_flag=True,
+    help="Reverse the coordinates before fixing",
+)
 def fix(
     infile: File,
     force_north_pole: bool,
     force_south_pole: bool,
     fix_winding: bool,
     great_circle: bool,
+    reverse: bool,
 ) -> None:
     """Fixes any antimeridian problems a GeoJSON file
 
@@ -77,6 +85,7 @@ def fix(
         force_south_pole=force_south_pole,
         fix_winding=fix_winding,
         great_circle=great_circle,
+        reverse=reverse,
     )
     print(json.dumps(fixed))
 


=====================================
src/antimeridian/_implementation.py
=====================================
@@ -75,6 +75,7 @@ def fix_geojson(
     force_south_pole: bool = False,
     fix_winding: bool = True,
     great_circle: bool = True,
+    reverse: bool = False,
 ) -> Dict[str, Any]:
     """Fixes a GeoJSON object that crosses the antimeridian.
 
@@ -93,6 +94,7 @@ def fix_geojson(
             coordinates before applying the algorithm.
         great_circle: Compute meridian crossings on the sphere rather than
             using 2D geometry.
+        reverse: Reverse the coordinates before fixing.
 
     Return:
         The same GeoJSON with a fixed geometry or geometries
@@ -110,6 +112,7 @@ def fix_geojson(
             force_south_pole=force_south_pole,
             fix_winding=fix_winding,
             great_circle=great_circle,
+            reverse=reverse,
         )
         return geojson
     elif type_ == "FeatureCollection":
@@ -123,6 +126,7 @@ def fix_geojson(
                 force_south_pole=force_south_pole,
                 fix_winding=fix_winding,
                 great_circle=great_circle,
+                reverse=reverse,
             )
         geojson["features"] = features
         return geojson
@@ -133,6 +137,7 @@ def fix_geojson(
             force_south_pole=force_south_pole,
             fix_winding=fix_winding,
             great_circle=great_circle,
+            reverse=reverse,
         )
 
 
@@ -177,6 +182,7 @@ def fix_shape(
     force_south_pole: bool = False,
     fix_winding: bool = True,
     great_circle: bool = True,
+    reverse: bool = False,
 ) -> Dict[str, Any]:
     """Fixes a shape that crosses the antimeridian.
 
@@ -195,11 +201,14 @@ def fix_shape(
             coordinates before applying the algorithm.
         great_circle: Compute meridian crossings on the sphere rather than
             using 2D geometry.
+        reverse: Reverse the coordinates before fixing.
 
     Returns:
         The fixed shape as a dictionary
     """
     geom = shapely.geometry.shape(shape)
+    if reverse:
+        geom = geom.reverse()
     if geom.geom_type == "Polygon":
         return cast(
             Dict[str, Any],
@@ -332,7 +341,7 @@ def fix_polygon(
 
     Returns:
         The fixed polygon, either as a single polygon or a multi-polygon (if it
-        was split)
+            was split)
     """
     if force_north_pole or force_south_pole:
         fix_winding = False


=====================================
tests/data/input/issues-164.json
=====================================
@@ -0,0 +1 @@
+{"type":"Polygon","coordinates":[[[141.592557,-54.046261],[141.380479,-54.390833],[141.151119,-54.736096],[138.458651,-44.174214],[137.470414,-39.708878],[136.759578,-36.370839],[136.180892,-33.600781],[135.68165,-31.188057],[135.235969,-29.026083],[134.828987,-27.052082],[134.451287,-25.2254],[134.096486,-23.517926],[133.760026,-21.90927],[133.438532,-20.384084],[133.129416,-18.930471],[132.830648,-17.53899],[132.540599,-16.201998],[132.257935,-14.913199],[131.981547,-13.667339],[131.710501,-12.459973],[131.443996,-11.2873],[131.181341,-10.14604],[130.921929,-9.033335],[130.665224,-7.946676],[130.410749,-6.883847],[130.15807,-5.842875],[129.906795,-4.821992],[129.656562,-3.819608],[129.407039,-2.834285],[129.157912,-1.864712],[128.908887,-0.909694],[128.659686,0.031868],[128.410044,0.960985],[128.159702,1.878595],[127.908413,2.785567],[127.655933,3.682713],[127.402024,4.570793],[127.146449,5.450521],[126.888974,6.322571],[126.629363,7.187578],[126.36738,8.046148],[126.102783,8.898858],[125.835331,9.746259],[125.564774,10.588879],[125.290855,11.427228],[125.013311,12.261797],[124.731871,13.093064],[124.446249,13.921493],[124.156152,14.747536],[123.861269,15.571638],[123.561276,16.394234],[123.255833,17.215754],[122.944578,18.036625],[122.62713,18.85727],[122.303083,19.67811],[121.972005,20.499567],[121.633435,21.322066],[121.28688,22.146031],[120.931809,22.971896],[120.567654,23.800096],[120.193797,24.631078],[119.809575,25.465296],[119.414266,26.303216],[119.007085,27.145316],[118.587176,27.99209],[118.153603,28.84405],[117.70534,29.701726],[117.241257,30.565671],[116.760109,31.436461],[116.260517,32.314703],[115.740946,33.201033],[115.199689,34.096121],[114.634832,35.000679],[114.044225,35.915459],[113.425441,36.841265],[112.775729,37.778952],[112.091954,38.729441],[111.370522,39.693716],[110.607296,40.672842],[109.797476,41.667968],[108.935461,42.680341],[108.014667,43.711317],[107.027285,44.762374],[105.963975,45.835128],[104.813454,46.931348],[103.561935,48.052973],[102.192355,49.202129],[100.683293,50.38114],[99.007405,51.592532],[97.129088,52.83902],[95.000903,54.123443],[92.557823,55.448619],[89.707496,56.816999],[86.312588,58.229866],[82.155574,59.685407],[76.858021,61.173557],[69.647739,62.659174],[58.270355,63.995942],[37.989449,63.948282],[38.628539,64.181107],[-138.452017,76.980811],[-137.424062,76.462045],[-136.490749,75.922917],[-135.646298,75.363412],[-134.885226,74.783428],[-134.20236,74.182777],[-133.592853,73.561194],[-133.05218,72.918334],[-132.576132,72.253777],[-132.160805,71.567033],[-156.494752,71.053364],[-169.783854,69.031184],[-177.162866,66.977247],[177.945237,65.023206],[174.423026,63.179248],[171.754922,61.436529],[169.662114,59.783319],[167.97831,58.208583],[166.597287,56.702717],[165.447629,55.257551],[164.479348,53.866162],[163.656308,52.522668],[162.951675,51.22204],[162.345073,49.959951],[161.82073,48.732648],[161.366234,47.536858],[160.971679,46.3697],[160.629056,45.228626],[160.331823,44.11137],[160.074577,43.015897],[159.852825,41.940379],[159.662796,40.883155],[159.501307,39.842717],[159.365656,38.817682],[159.253535,37.80678],[159.162965,36.808836],[159.092244,35.82276],[159.039903,34.847535],[159.004672,33.882207],[158.985451,32.925881],[158.981288,31.977707],[158.991358,31.036881],[159.014949,30.102633],[159.051448,29.174228],[159.100332,28.250955],[159.161157,27.332128],[159.233548,26.417081],[159.317201,25.50516],[159.411869,24.595727],[159.517363,23.688149],[159.633549,22.781803],[159.760342,21.876064],[159.89771,20.970308],[160.045667,20.063907],[160.204277,19.156225],[160.373652,18.246617],[160.553954,17.334422],[160.7454,16.41896],[160.948256,15.499529],[161.162848,14.575402],[161.389565,13.645816],[161.628861,12.709973],[161.881264,11.767029],[162.147383,10.816089],[162.427919,9.856196],[162.723676,8.886324],[163.035575,7.905363],[163.364671,6.912108],[163.712177,5.90524],[164.079489,4.883308],[164.46822,3.844701],[164.880241,2.78762],[165.317739,1.710041],[165.78328,0.609662],[166.279905,-0.516158],[166.811245,-1.670478],[167.381687,-2.856888],[167.996595,-4.079654],[168.662625,-5.343929],[169.388184,-6.656044],[170.184113,-8.023954],[171.06476,-9.457905],[172.049735,-10.97154],[173.166971,-12.583775],[174.458513,-14.322325],[175.992728,-16.231022],[177.894586,-18.387746],[-179.556247,-20.961679],[-175.347869,-24.54512],[-169.539657,-28.815911],[-170.177735,-29.193505],[-170.810287,-29.547431],[-171.437189,-29.878643],[-172.058332,-30.188056],[-172.673612,-30.476547],[-173.282939,-30.744955],[-173.886231,-30.994086],[-174.483417,-31.224708],[-175.074434,-31.437559],[-175.659227,-31.633344],[141.592557,-54.046261]]]}


=====================================
tests/data/output/flat/issues-164.json
=====================================
@@ -0,0 +1 @@
+{"type": "MultiPolygon", "coordinates": [[[[-180.0, -43.4035023], [-175.659227, -31.633344], [-175.074434, -31.437559], [-174.483417, -31.224708], [-173.886231, -30.994086], [-173.282939, -30.744955], [-172.673612, -30.476547], [-172.058332, -30.188056], [-171.437189, -29.878643], [-170.810287, -29.547431], [-170.177735, -29.193505], [-169.539657, -28.815911], [-175.347869, -24.54512], [-179.556247, -20.961679], [-180.0, -19.6717318], [-180.0, -43.4035023]]], [[[180.0, -19.6717318], [177.894586, -18.387746], [175.992728, -16.231022], [174.45851300000004, -14.322325], [173.166971, -12.583775], [172.049735, -10.97154], [171.06475999999998, -9.457905], [170.18411300000002, -8.023954], [169.38818400000002, -6.656044], [168.662625, -5.343929], [167.996595, -4.079654], [167.381687, -2.856888], [166.81124499999999, -1.670478], [166.27990499999999, -0.516158], [165.78328, 0.609662], [165.31773899999996, 1.710041], [164.880241, 2.78762], [164.46821999999997, 3.844701], [164.07948899999997, 4.883308], [163.712177, 5.90524], [163.364671, 6.912108], [163.035575, 7.905363], [162.723676, 8.886324], [162.42791899999997, 9.856196], [162.147383, 10.816089], [161.881264, 11.767029], [161.62886100000003, 12.709973], [161.389565, 13.645816], [161.162848, 14.575402], [160.94825600000001, 15.499529], [160.74540000000002, 16.41896], [160.55395399999998, 17.334422], [160.373652, 18.246617], [160.204277, 19.156225], [160.04566699999998, 20.063907], [159.89770999999996, 20.970308], [159.76034200000004, 21.876064], [159.63354900000002, 22.781803], [159.517363, 23.688149], [159.41186900000002, 24.595727], [159.317201, 25.50516], [159.23354800000004, 26.417081], [159.161157, 27.332128], [159.10033199999998, 28.250955], [159.051448, 29.174228], [159.014949, 30.102633], [158.991358, 31.036881], [158.981288, 31.977707], [158.985451, 32.925881], [159.00467200000003, 33.882207], [159.03990299999998, 34.847535], [159.092244, 35.82276], [159.16296499999999, 36.808836], [159.253535, 37.80678], [159.365656, 38.817682], [159.501307, 39.842717], [159.66279599999996, 40.883155], [159.852825, 41.940379], [160.07457699999998, 43.015897], [160.33182299999999, 44.11137], [160.629056, 45.228626], [160.971679, 46.3697], [161.36623399999996, 47.536858], [161.82073000000003, 48.732648], [162.345073, 49.959951], [162.95167500000002, 51.22204], [163.65630799999997, 52.522668], [164.47934799999996, 53.866162], [165.447629, 55.257551], [166.597287, 56.702717], [167.97830999999996, 58.208583], [169.66211399999997, 59.783319], [171.75492199999997, 61.436529], [174.423026, 63.179248], [177.94523700000002, 65.023206], [180.0, 66.0012954], [180.0, 90.0], [-180.0, 90.0], [-180.0, 66.0012954], [-177.162866, 66.977247], [-169.783854, 69.031184], [-156.494752, 71.053364], [-132.160805, 71.567033], [-132.576132, 72.253777], [-133.05218, 72.918334], [-133.592853, 73.561194], [-134.20236, 74.182777], [-134.885226, 74.783428], [-135.646298, 75.363412], [-136.490749, 75.922917], [-137.424062, 76.462045], [-138.452017, 76.980811], [38.62853899999999, 64.181107], [37.98944900000001, 63.948282], [58.270354999999995, 63.995942], [69.647739, 62.659174], [76.85802100000001, 61.173557], [82.155574, 59.685407], [86.312588, 58.229866], [89.70749599999999, 56.816999], [92.55782299999998, 55.448619], [95.000903, 54.123443], [97.12908800000002, 52.83902], [99.007405, 51.592532], [100.68329299999999, 50.38114], [102.19235500000002, 49.202129], [103.561935, 48.052973], [104.81345399999998, 46.931348], [105.963975, 45.835128], [107.027285, 44.762374], [108.01466700000003, 43.711317], [108.93546100000003, 42.680341], [109.79747600000002, 41.667968], [110.60729600000002, 40.672842], [111.370522, 39.693716], [112.09195399999999, 38.729441], [112.77572900000001, 37.778952], [113.42544099999998, 36.841265], [114.04422499999998, 35.915459], [114.63483200000002, 35.000679], [115.19968900000003, 34.096121], [115.74094600000001, 33.201033], [116.260517, 32.314703], [116.760109, 31.436461], [117.24125700000002, 30.565671], [117.70533999999998, 29.701726], [118.15360299999998, 28.84405], [118.587176, 27.99209], [119.00708500000002, 27.145316], [119.414266, 26.303216], [119.809575, 25.465296], [120.19379700000002, 24.631078], [120.567654, 23.800096], [120.93180899999999, 22.971896], [121.28688, 22.146031], [121.63343500000002, 21.322066], [121.97200499999997, 20.499567], [122.30308300000002, 19.67811], [122.62712999999997, 18.85727], [122.94457799999998, 18.036625], [123.255833, 17.215754], [123.56127600000002, 16.394234], [123.861269, 15.571638], [124.15615200000002, 14.747536], [124.44624899999997, 13.921493], [124.73187100000001, 13.093064], [125.01331099999999, 12.261797], [125.29085499999997, 11.427228], [125.564774, 10.588879], [125.835331, 9.746259], [126.10278299999999, 8.898858], [126.36738000000003, 8.046148], [126.62936300000001, 7.187578], [126.88897400000002, 6.322571], [127.14644900000002, 5.450521], [127.40202399999998, 4.570793], [127.655933, 3.682713], [127.908413, 2.785567], [128.15970200000004, 1.878595], [128.41004399999997, 0.960985], [128.65968599999997, 0.031868], [128.908887, -0.909694], [129.157912, -1.864712], [129.407039, -2.834285], [129.656562, -3.819608], [129.906795, -4.821992], [130.15807, -5.842875], [130.410749, -6.883847], [130.66522399999997, -7.946676], [130.92192899999998, -9.033335], [131.18134099999997, -10.14604], [131.44399599999997, -11.2873], [131.71050100000002, -12.459973], [131.98154699999998, -13.667339], [132.25793499999997, -14.913199], [132.540599, -16.201998], [132.830648, -17.53899], [133.129416, -18.930471], [133.438532, -20.384084], [133.76002600000004, -21.90927], [134.09648600000003, -23.517926], [134.45128699999998, -25.2254], [134.82898699999998, -27.052082], [135.235969, -29.026083], [135.68165, -31.188057], [136.18089199999997, -33.600781], [136.75957800000003, -36.370839], [137.470414, -39.708878], [138.45865100000003, -44.174214], [141.151119, -54.736096], [141.38047900000004, -54.390833], [141.592557, -54.046261], [180.0, -43.4035023], [180.0, -19.6717318]]]]}


=====================================
tests/data/output/spherical/issues-164.json
=====================================
@@ -0,0 +1 @@
+{"type": "MultiPolygon", "coordinates": [[[[-180.0, -35.6607683], [-175.659227, -31.633344], [-175.074434, -31.437559], [-174.483417, -31.224708], [-173.886231, -30.994086], [-173.282939, -30.744955], [-172.673612, -30.476547], [-172.058332, -30.188056], [-171.437189, -29.878643], [-170.810287, -29.547431], [-170.177735, -29.193505], [-169.539657, -28.815911], [-175.347869, -24.54512], [-179.556247, -20.961679], [-180.0, -20.5222082], [-180.0, -35.6607683]]], [[[180.0, -20.5222082], [177.894586, -18.387746], [175.992728, -16.231022], [174.45851300000004, -14.322325], [173.166971, -12.583775], [172.049735, -10.97154], [171.06475999999998, -9.457905], [170.18411300000002, -8.023954], [169.38818400000002, -6.656044], [168.662625, -5.343929], [167.996595, -4.079654], [167.381687, -2.856888], [166.81124499999999, -1.670478], [166.27990499999999, -0.516158], [165.78328, 0.609662], [165.31773899999996, 1.710041], [164.880241, 2.78762], [164.46821999999997, 3.844701], [164.07948899999997, 4.883308], [163.712177, 5.90524], [163.364671, 6.912108], [163.035575, 7.905363], [162.723676, 8.886324], [162.42791899999997, 9.856196], [162.147383, 10.816089], [161.881264, 11.767029], [161.62886100000003, 12.709973], [161.389565, 13.645816], [161.162848, 14.575402], [160.94825600000001, 15.499529], [160.74540000000002, 16.41896], [160.55395399999998, 17.334422], [160.373652, 18.246617], [160.204277, 19.156225], [160.04566699999998, 20.063907], [159.89770999999996, 20.970308], [159.76034200000004, 21.876064], [159.63354900000002, 22.781803], [159.517363, 23.688149], [159.41186900000002, 24.595727], [159.317201, 25.50516], [159.23354800000004, 26.417081], [159.161157, 27.332128], [159.10033199999998, 28.250955], [159.051448, 29.174228], [159.014949, 30.102633], [158.991358, 31.036881], [158.981288, 31.977707], [158.985451, 32.925881], [159.00467200000003, 33.882207], [159.03990299999998, 34.847535], [159.092244, 35.82276], [159.16296499999999, 36.808836], [159.253535, 37.80678], [159.365656, 38.817682], [159.501307, 39.842717], [159.66279599999996, 40.883155], [159.852825, 41.940379], [160.07457699999998, 43.015897], [160.33182299999999, 44.11137], [160.629056, 45.228626], [160.971679, 46.3697], [161.36623399999996, 47.536858], [161.82073000000003, 48.732648], [162.345073, 49.959951], [162.95167500000002, 51.22204], [163.65630799999997, 52.522668], [164.47934799999996, 53.866162], [165.447629, 55.257551], [166.597287, 56.702717], [167.97830999999996, 58.208583], [169.66211399999997, 59.783319], [171.75492199999997, 61.436529], [174.423026, 63.179248], [177.94523700000002, 65.023206], [180.0, 65.8997172], [180.0, 90.0], [-180.0, 90.0], [-180.0, 65.8997172], [-177.162866, 66.977247], [-169.783854, 69.031184], [-156.494752, 71.053364], [-132.160805, 71.567033], [-132.576132, 72.253777], [-133.05218, 72.918334], [-133.592853, 73.561194], [-134.20236, 74.182777], [-134.885226, 74.783428], [-135.646298, 75.363412], [-136.490749, 75.922917], [-137.424062, 76.462045], [-138.452017, 76.980811], [38.62853899999999, 64.181107], [37.98944900000001, 63.948282], [58.270354999999995, 63.995942], [69.647739, 62.659174], [76.85802100000001, 61.173557], [82.155574, 59.685407], [86.312588, 58.229866], [89.70749599999999, 56.816999], [92.55782299999998, 55.448619], [95.000903, 54.123443], [97.12908800000002, 52.83902], [99.007405, 51.592532], [100.68329299999999, 50.38114], [102.19235500000002, 49.202129], [103.561935, 48.052973], [104.81345399999998, 46.931348], [105.963975, 45.835128], [107.027285, 44.762374], [108.01466700000003, 43.711317], [108.93546100000003, 42.680341], [109.79747600000002, 41.667968], [110.60729600000002, 40.672842], [111.370522, 39.693716], [112.09195399999999, 38.729441], [112.77572900000001, 37.778952], [113.42544099999998, 36.841265], [114.04422499999998, 35.915459], [114.63483200000002, 35.000679], [115.19968900000003, 34.096121], [115.74094600000001, 33.201033], [116.260517, 32.314703], [116.760109, 31.436461], [117.24125700000002, 30.565671], [117.70533999999998, 29.701726], [118.15360299999998, 28.84405], [118.587176, 27.99209], [119.00708500000002, 27.145316], [119.414266, 26.303216], [119.809575, 25.465296], [120.19379700000002, 24.631078], [120.567654, 23.800096], [120.93180899999999, 22.971896], [121.28688, 22.146031], [121.63343500000002, 21.322066], [121.97200499999997, 20.499567], [122.30308300000002, 19.67811], [122.62712999999997, 18.85727], [122.94457799999998, 18.036625], [123.255833, 17.215754], [123.56127600000002, 16.394234], [123.861269, 15.571638], [124.15615200000002, 14.747536], [124.44624899999997, 13.921493], [124.73187100000001, 13.093064], [125.01331099999999, 12.261797], [125.29085499999997, 11.427228], [125.564774, 10.588879], [125.835331, 9.746259], [126.10278299999999, 8.898858], [126.36738000000003, 8.046148], [126.62936300000001, 7.187578], [126.88897400000002, 6.322571], [127.14644900000002, 5.450521], [127.40202399999998, 4.570793], [127.655933, 3.682713], [127.908413, 2.785567], [128.15970200000004, 1.878595], [128.41004399999997, 0.960985], [128.65968599999997, 0.031868], [128.908887, -0.909694], [129.157912, -1.864712], [129.407039, -2.834285], [129.656562, -3.819608], [129.906795, -4.821992], [130.15807, -5.842875], [130.410749, -6.883847], [130.66522399999997, -7.946676], [130.92192899999998, -9.033335], [131.18134099999997, -10.14604], [131.44399599999997, -11.2873], [131.71050100000002, -12.459973], [131.98154699999998, -13.667339], [132.25793499999997, -14.913199], [132.540599, -16.201998], [132.830648, -17.53899], [133.129416, -18.930471], [133.438532, -20.384084], [133.76002600000004, -21.90927], [134.09648600000003, -23.517926], [134.45128699999998, -25.2254], [134.82898699999998, -27.052082], [135.235969, -29.026083], [135.68165, -31.188057], [136.18089199999997, -33.600781], [136.75957800000003, -36.370839], [137.470414, -39.708878], [138.45865100000003, -44.174214], [141.151119, -54.736096], [141.38047900000004, -54.390833], [141.592557, -54.046261], [180.0, -35.6607683], [180.0, -20.5222082]]]]}


=====================================
tests/test_geojson.py
=====================================
@@ -1,6 +1,7 @@
 import copy
 
 import pytest
+import shapely.geometry
 
 import antimeridian
 
@@ -41,3 +42,19 @@ def test_segment_feature(read_input: Reader, great_circle: bool) -> None:
     feature = {"type": "Feature", "geometry": input}
     fixed = antimeridian.segment_geojson(feature, great_circle)
     assert len(fixed.geoms) == 2
+
+
+ at pytest.mark.parametrize(
+    "subdirectory,great_circle",
+    [("flat", False), ("spherical", True)],
+)
+def test_reverse(
+    read_input: Reader, read_output: Reader, subdirectory: str, great_circle: bool
+) -> None:
+    input = read_input("issues-164")
+    feature = {"type": "Feature", "geometry": input}
+    fixed = antimeridian.fix_geojson(feature, reverse=True, great_circle=great_circle)
+    assert (
+        shapely.geometry.shape(fixed["geometry"]).normalize()
+        == read_output("issues-164", subdirectory).normalize()
+    )


=====================================
uv.lock
=====================================
The diff for this file was not included because it is too large.


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

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/antimeridian/-/commit/5a6d670e94f126982a0b07b3e16a90b88df02f2a
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/20250413/7c7b61eb/attachment-0001.htm>


More information about the Pkg-grass-devel mailing list