Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotFound is returned when a timezone is not found ErrNotFound = errors.New("timezone not found") ErrInternal = errors.New("shape without tzID") )
Functions ¶
Types ¶
type Geo2TzRTreeIndex ¶
type Geo2TzRTreeIndex struct {
// contains filtered or unexported fields
}
func NewGeo2TzRTreeIndexFromGeoJSON ¶
func NewGeo2TzRTreeIndexFromGeoJSON(geoJSONPath string) (*Geo2TzRTreeIndex, error)
NewGeo2TzRTreeIndexFromGeoJSON creates a new Geo2TzRTreeIndex from a GeoJSON file
func (*Geo2TzRTreeIndex) Insert ¶
func (g *Geo2TzRTreeIndex) Insert(min, max [2]float64, element timezoneGeo)
Insert adds a new timezone bounding box to the index
func (*Geo2TzRTreeIndex) Lookup ¶
func (g *Geo2TzRTreeIndex) Lookup(lat, lng float64) (tzID string, err error)
Lookup returns the timezone ID for a given latitude and longitude if the timezone is not found, it returns an error It first searches in the land index, if not found, it searches in the sea index
Click to show internal directories.
Click to hide internal directories.