Categorygithub.com/go-geospatial/antimeridian
modulepackage
1.0.0
Repository: https://github.com/go-geospatial/antimeridian.git
Documentation: pkg.go.dev

# README

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)

# Functions

Contains checks if polygon is contained by the polygon containedBy.
ContainsPoint checks if the point pt is within the linear ring.
Cut divides a geometry at the antimeridian and the poles.

# Variables

No description provided by the author
No description provided by the author