Documentation ¶
Overview ¶
Package tool copied from https://gist.github.com/antoniomo/3371e44cbe2f0cc75a525aac0d188cfb
Index ¶
- Constants
- Variables
- func AngleToKm(angle s1.Angle) float64
- func ConvertLatLon(lat, lon string) (float64, float64)
- func KmToAngle(km float64) s1.Angle
- func PointsInCellID(s2cap s2.Cap, cov s2.CellID, center Point, points []Point)
- func Run(opts *RunOptions)
- func Splitter(s string, opts *SplitterOpts, vars ...*string) error
- type Point
- type RunOptions
- type SplitterOpts
Constants ¶
View Source
const ( EarthRadiusKm = 6371.01 // Earth's mean radius, km (according to NASA). Helsinki = "helsinki" Oxford = "oxford" OxfordPubs = "oxford-pubs" PointDelimiter = "::" PointsDelimiter = "|" Tolkien = "tolkien" )
Tool constants
Variables ¶
View Source
var ( HelsinkiCenter = "60.1699::24.9384::Helsinki Center" HelsinkiExamplePoints = "60.2934::25.0378::Vantaa Center|" + "60.2055::24.6559::Espoo Center|" + "60.1699::24.9380::Person in Helsinki|" + "50.0::150.0::Seah of Okhotsk|" + "50.0::-150.0::North Pacific Ocean|" + "50.0::50.0::Western Kazakhstan|" + "50.0::-50.0::Labrador Sea" OxfordExamplePoints = "51.751944::-1.257778::Oxford|" + "51.7572::-1.2603::The Eagle and Child|" + "51.507222::-0.1275::London|" + "51.48::0::Greenwich|" + "52.205278::0.119167::Cambridge|" + "42.116667::-71.865278::Oxford, Massachusetts|" + "-43.312778::172.190556::Oxford, New Zealand" // Pints points OxfordPubExamplePoints = "51.7572::-1.2603::The Eagle and Child|" + "51.7550609::-1.2617064::Morse Bar|" + "51.755::-1.2544::The King's Arms|" + "51.7546135::-1.2577909::The White Horse|" + "51.7547::-1.253::The Turf Tavern" TolkiensHouse = "51.770903::-1.2626219::Tolkien's House" )
Example Points
View Source
var PointSplitterOpts = &SplitterOpts{ MinVars: 2, MaxVars: 3, Delimiter: PointDelimiter, }
PointSplitterOpts ...
Functions ¶
func KmToAngle ¶
KmToAngle converts a distance on the Earth's surface to an angle. https://github.com/golang/geo/blob/23949e136d58aeb8aa39844a312b68d90c4eb8aa/s2/s2_test.go#L38-L43
func PointsInCellID ¶
PointsInCellID ...
Types ¶
type RunOptions ¶
type RunOptions struct { CapRadius float64 CenterPoint string MaxCells int MaxLevel int Points string }
RunOptions ...
type SplitterOpts ¶
SplitterOpts ...
Click to show internal directories.
Click to hide internal directories.