Package antimeridian fixes shapes that cross the antimeridian.
Lines and Polygons that cross the antimeridian are problematic for many web mapping packages and PostGIS. The official GeoJSON spec recommends features that cross the antimeridian, "SHOULD be represented by cutting it in two such that neither part's representation crosses the antimeridian."
This package will cut polygons and multi-polygons that cross the anti-meridian into multiple polygons that do not cross the anti-meridian. It will also force polygons to use the right-hand rule for polygon winding. Exterior rings must be wound in counter-clockwise order and interior rings are wound clockwise.
go get github.com/go-geospatial/antimeridianThen:
fixedGeom := antimeridian.Cut(geomCrossingAntiMeridian)This package is heavily inspired by / partially ported from the python antimeridian package.
The illustration is provided by Pawarit Laosunthara from his post Around the world in 80 lines
