Documentation ¶
Index ¶
- Constants
- Variables
- func ImportZipFile(cache string, url string, iter func(tz Timezone) error) (err error)
- func Verbose(v bool)
- type GeoJSONFeature
- type Result
- type Timezone
- type Timezonecache
- func (tzc *Timezonecache) AddTimezone(tz Timezone)
- func (tzc *Timezonecache) BuildRtree()
- func (tzc *Timezonecache) Close() error
- func (tzc *Timezonecache) Load(f *os.File) (err error)
- func (tzc *Timezonecache) Save(filename string) error
- func (tzc *Timezonecache) Search(lat, lng float64) (Result, error)
Constants ¶
View Source
const (
DefaultURL = "https://github.com/evansiroky/timezone-boundary-builder/releases/download/2020d/timezones-with-oceans.geojson.zip"
)
Variables ¶
View Source
var (
ErrCoordinatesNotValid = errors.New("Latitude and/or Longitude are not valid")
)
Functions ¶
func ImportZipFile ¶
ImportZipFile imports a url and saves it with the following filename. The iter function is run on the zip file.
Types ¶
type GeoJSONFeature ¶
type GeoJSONFeature struct { Type string `json:"type"` Properties struct { Tzid string `json:"tzid"` } `json:"properties"` Geometry struct { Item string `json:"type"` Coordinates []interface{} `json:"coordinates"` } `json:"geometry"` }
GeoJSONFeature
type Timezonecache ¶
type Timezonecache struct {
// contains filtered or unexported fields
}
func (*Timezonecache) AddTimezone ¶
func (tzc *Timezonecache) AddTimezone(tz Timezone)
func (*Timezonecache) BuildRtree ¶
func (tzc *Timezonecache) BuildRtree()
func (*Timezonecache) Close ¶
func (tzc *Timezonecache) Close() error
func (*Timezonecache) Save ¶
func (tzc *Timezonecache) Save(filename string) error
Click to show internal directories.
Click to hide internal directories.