jutlandLat
untyped bigdecThe 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 bigdecThe 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 bigdecThe 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 bigdecThe 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 stringThe 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) stringRender 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
- OID
- 0d6f24…a22d:3
Render details
renderPrecision
func() stringrenderPrecision shows one point at every length, which is the property that makes a geohash worth storing: the prefix is the same place, zoomed out.
- OID
- 0d6f24…a22d:5
renderPrecision details
renderCell
func() stringrenderCell shows that a geohash is a box and not a point, which is the thing most callers get wrong about it.
- OID
- 0d6f24…a22d:6
renderCell details
renderNeighbors
func() stringrenderNeighbors shows the eight cells around one, and the wrap that the classic lookup-table implementations do not do.
- OID
- 0d6f24…a22d:7
renderNeighbors details
bullet
func(name string, lat float64, lon float64, precision int) stringbullet renders one named place as a list item.
- OID
- 0d6f24…a22d:8
bullet details
coord
func(lat float64, lon float64) stringcoord formats a latitude and longitude pair.
- OID
- 0d6f24…a22d:9
coord details
num
func(v float64) stringnum 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.
- OID
- 0d6f24…a22d:10
num details
yesNo
func(ok bool) stringyesNo renders a containment answer as a sentence fragment.
- OID
- 0d6f24…a22d:11
yesNo details
pad
func(s string, n int) stringpad right-aligns a short string to width n, so the precision column lines up inside the code block.
- OID
- 0d6f24…a22d:12
pad details
parseArg
func(path string) stringparseArg extracts the first path segment.
- OID
- 0d6f24…a22d:13