Install & Compatibility
Where this runs
tested against v0.4.7 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
py 3.9
✕ build_error
✓ 4.6s
101MB installed
● package 101MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
fix_geojson
✓ from antimeridian import fix_geojson
✗ import antimeridian
Top-level function; no more antimeridian.fix_geojson() needed; direct import recommended.
fix_polygon
✓ from antimeridian import fix_polygon
Lower-level function for single polygons.
Correct a simple polygon crossing the antimeridian (180° longitude).
from antimeridian import fix_geojson
import json
geojson = {
"type": "Polygon",
"coordinates": [[
[179.0, -10.0],
[-179.0, -10.0],
[-179.0, 10.0],
[179.0, 10.0],
[179.0, -10.0]
]]
}
# Fix the geometry
fixed = fix_geojson(geojson)
print(json.dumps(fixed, indent=2))
Errors
Common errors & fixes
ValueError: Expected a GeoJSON geometry object, got list
Passed a list of coordinates instead of a geometry dict.
fixWrap coordinates in a valid GeoJSON structure: {'type': 'Polygon', 'coordinates': your_list} antimeridian.InvalidGeometryError: Geometry type not supported: LineString
Attempted to fix a non-polygonal geometry type that antimeridian cannot handle.
fixOnly Polygon, MultiPolygon, and their derivatives (e.g., in a Feature) are supported. For other types, use other libraries or preprocess.
TypeError: fix_geojson() missing 1 required positional argument: 'geometry'
Called fix_geojson without arguments or with incorrect keyword.
fixUse: fix_geojson(geometry_dict)
Upgrade
Version history
0.4.7latest on PyPI · released Apr 3, 2026
Audit
Dependencies
shapelyrequiredGeometry operations; used internally for splitting and validation.
numpyrequiredArray operations for coordinate calculations.