Discover Packages
github.com/ringsaturn/tzf
package
module
Version:
v0.1.0
Opens a new window with list of versions in this module.
Published: May 29, 2022
License: MIT
Opens a new window with license information.
Imports: 4
Opens a new window with list of imports.
Imported by: 12
Opens a new window with list of known importers.
README
README
¶
TZF: a timezone finder for Go.
graph TD
C[H3 Based Approximation file]
D[Probuf based Bin file]
H[Polygon search component]
D --> |Reduce via cmd/reducePolygon|D
A[Raw timezone boundary JSON file] --> |Convert via cmd/tzjson2pb|D
D --> |Uber H3 Polyfill|C
D --> H
C --> GetTimezone
H --> GetTimezone
TODO:
POC: polygon search based
Reduce Polygon size option
Reduce float precise
Reduce line numbers
H3 Based Approximation, something like Placekey
Expand ▾
Collapse ▴
Documentation
¶
Package tzf is a package convert (lng,lat) to timezone.
Inspired by timezonefinder https://github.com/jannikmi/timezonefinder ,
fast python package for finding the timezone of any point on earth (coordinates) offline.
package main
import (
"fmt"
"github.com/ringsaturn/tzf"
)
var f *tzf.Finder
func main() {
fmt.Println(f.GetTimezoneLoc(116.6386, 40.0786))
}
Output:
Asia/Shanghai <nil>
package main
import (
"fmt"
"github.com/ringsaturn/tzf"
)
var f *tzf.Finder
func main() {
fmt.Println(f.GetTimezoneName(116.6386, 40.0786))
}
Output:
Asia/Shanghai
Source Files
¶
Directories
¶
cmd
tzjson2pb
CLI tool to convert GeoJSON based Timezone boundary to tzf's Probuf format.
CLI tool to convert GeoJSON based Timezone boundary to tzf's Probuf format.
Click to show internal directories.
Click to hide internal directories.