geo

package
Version: v0.0.0-...-70939e7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 5, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//EarthRadius the radius of earth in kilometers
	EarthRadius = 6371.01
)

Variables

This section is empty.

Functions

func CoverPoint

func CoverPoint(p Point, maxLevel int) (s2.Cell, string, [][][]float64)

CoverPoint converts a point to cell based on given level

func CoverPolygon

func CoverPolygon(p *s2.Polygon, maxLevel, minLevel int) (s2.CellUnion, []string, [][][]float64)

CoverPolygon converts s2 polygon to cell union and returns the respective cells

func DecodeGeoJSON

func DecodeGeoJSON(json []byte) ([]*geojson.Feature, error)

DecodeGeoJSON decodes a feature collection

func EdgesOfCell

func EdgesOfCell(c s2.Cell) [][]float64

EdgesOfCell gets the edges of the cell

func PointsToPolygon

func PointsToPolygon(points [][]float64) *s2.Polygon

PointsToPolygon converts points to s2 polygon

Types

type Point

type Point struct {
	Lat float64
	Lng float64
}

Point struct contains the lat/lng of a point

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL