Skip to content Search Apps Documentation Source Content File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

v0 state

Back to all declarations

jutlandLat

untyped bigdec

The three fixed points the demo encodes. Coordinates only, so nothing here depends on the chain, the clock or the caller.

Value

(57.64911 <untyped> bigdec)

jutlandLon

untyped bigdec

The three fixed points the demo encodes. Coordinates only, so nothing here depends on the chain, the clock or the caller.

Value

(10.40744 <untyped> bigdec)

leonLat

untyped bigdec

The three fixed points the demo encodes. Coordinates only, so nothing here depends on the chain, the clock or the caller.

Value

(42.6 <untyped> bigdec)

leonLon

untyped bigdec

The three fixed points the demo encodes. Coordinates only, so nothing here depends on the chain, the clock or the caller.

Value

(-5.6 <untyped> bigdec)

sampleHash

untyped string

The three fixed points the demo encodes. Coordinates only, so nothing here depends on the chain, the clock or the caller.

Value

"ezs42"

Render

func(path string) string

Render renders the demo for gnoweb. Render("") / Render("/") -> a point at growing precision Render("/cell") -> the box a hash names Render("/neighbors") -> the eight cells around one, and the wrap

Open
OID
0d6f24…a22d:3
Render details

Inspect func

renderPrecision

func() string

renderPrecision shows one point at every length, which is the property that makes a geohash worth storing: the prefix is the same place, zoomed out.

Open
OID
0d6f24…a22d:5
renderPrecision details

Inspect func

renderCell

func() string

renderCell shows that a geohash is a box and not a point, which is the thing most callers get wrong about it.

Open
OID
0d6f24…a22d:6
renderCell details

Inspect func

renderNeighbors

func() string

renderNeighbors shows the eight cells around one, and the wrap that the classic lookup-table implementations do not do.

Open
OID
0d6f24…a22d:7
renderNeighbors details

Inspect func

bullet

func(name string, lat float64, lon float64, precision int) string

bullet renders one named place as a list item.

Open
OID
0d6f24…a22d:8
bullet details

Inspect func

coord

func(lat float64, lon float64) string

coord formats a latitude and longitude pair.

Open
OID
0d6f24…a22d:9
coord details

Inspect func

num

func(v float64) string

num formats a float with no trailing zeros. Every value this demo prints is an exact binary fraction, so the shortest round-trip form is also the exact one.

Open
OID
0d6f24…a22d:10
num details

Inspect func

yesNo

func(ok bool) string

yesNo renders a containment answer as a sentence fragment.

Open
OID
0d6f24…a22d:11
yesNo details

Inspect func

pad

func(s string, n int) string

pad right-aligns a short string to width n, so the precision column lines up inside the code block.

Open
OID
0d6f24…a22d:12
pad details

Inspect func

parseArg

func(path string) string

parseArg extracts the first path segment.

Open
OID
0d6f24…a22d:13
parseArg details

Inspect func
jutlandLat : untyped bigdec =(57.64911 <untyped> bigdec)
jutlandLon : untyped bigdec =(10.40744 <untyped> bigdec)
leonLat : untyped bigdec =(42.6 <untyped> bigdec)
leonLon : untyped bigdec =(-5.6 <untyped> bigdec)
sampleHash : untyped string ="ezs42"
Render : func(path string) string Inspect
renderPrecision : func() string Inspect
renderCell : func() string Inspect
renderNeighbors : func() string Inspect
bullet : func(name string, lat float64, lon float64, precision int) string Inspect
coord : func(lat float64, lon float64) string Inspect
num : func(v float64) string Inspect
yesNo : func(ok bool) string Inspect
pad : func(s string, n int) string Inspect
parseArg : func(path string) string Inspect