Documentation
¶
Overview ¶
package tenten implements "a coding system for entering any location on earth with 10m of accuracy using a 10 character code that includes features to prevent errors in entering the code." - purposed by john graham-cumming
reference:
http://blog.jgc.org/2010/06/1010-code.html? http://blog.jgc.org/2006/07/simple-code-for-entering-latitude-and.html
benchmark on my i7
BenchmarkEncode 10000000 174 ns/op BenchmarkEncodeSlow 500000 4880 ns/op
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrMalformedTT is returned if the 10:10 code is to short or missing spaces ErrMalformedTT = errors.New("10:10 code is to short or missing spaces") // ErrCorruptTT is returned if the 10:10 checksum is incorrect ErrCorruptTT = errors.New("10:10 checksum is incorrect") )
Functions ¶
func Encode ¶
Encode converts a (lat,lon) tuple to a human readable string
optimizations:
- using a fixed size array
- replace math.Mod() with integer modulo
- replaceing math.Floor with 0|(foo), to be pkg math-free (found here http://www.tapper-ware.net/blog/?p=112)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.