Skip to content

go-geospatial/antimeridian

Repository files navigation

antimeridian

PkgGoDev Go Report Card

Package antimeridian fixes shapes that cross the antimeridian.

Example Polygon

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.

Usage

go get github.com/go-geospatial/antimeridian

Then:

fixedGeom := antimeridian.Cut(geomCrossingAntiMeridian)

Credits

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages