tenten

package module
v0.0.0-...-2f0eec6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 6, 2014 License: MIT Imports: 2 Imported by: 0

README

go-tenten

GoDoc Build Status

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. -- John Graham-Cumming

reference:

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 Decode

func Decode(tt string) (lat, lon float64, err error)

Decode takes a 12 charachter string and converts them to latitude and longditude

func Encode

func Encode(lat, lon float64) string

Encode converts a (lat,lon) tuple to a human readable string

optimizations:

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL