def decode_exactly(geohash):
lat_interval, lon_interval = (-<NUM_LIT>, <NUM_LIT>), (-<NUM_LIT>, <NUM_LIT>)<EOL>lat_err, lon_err = <NUM_LIT>, <NUM_LIT><EOL>is_even = True<EOL>for c in geohash:<EOL><INDENT>cd = __decodemap[c]<EOL>for mask in [<NUM_LIT:16>, <NUM_LIT:8>, <NUM_LIT:4>, <NUM_LIT:2>, <NUM_LIT:1>]:<EOL><INDENT>if is_even: <EOL><INDENT>lon_err /= <NUM_LIT:2><EOL>if cd & mask:<EOL><INDENT>lon_interval = ((lon_interval[<NUM_LIT:0>]+lon_interval[<NUM_LIT:1>])/<NUM_LIT:2>, lon_interval[<NUM_LIT:1>])<EOL><DEDENT>else:<EOL><INDENT>lon_interval = (lon_interval[<NUM_LIT:0>], (lon_interval[<NUM_LIT:0>]+lon_interval[<NUM_LIT:1>])/<NUM_LIT:2>)<EOL><DEDENT><DEDENT>else:      <EOL><INDENT>lat_err /= <NUM_LIT:2><EOL>if cd & mask:<EOL><INDENT>lat_interval = ((lat_interval[<NUM_LIT:0>]+lat_interval[<NUM_LIT:1>])/<NUM_LIT:2>, lat_interval[<NUM_LIT:1>])<EOL><DEDENT>else:<EOL><INDENT>lat_interval = (lat_interval[<NUM_LIT:0>], (lat_interval[<NUM_LIT:0>]+lat_interval[<NUM_LIT:1>])/<NUM_LIT:2>)<EOL><DEDENT><DEDENT>is_even = not is_even<EOL><DEDENT><DEDENT>lat = (lat_interval[<NUM_LIT:0>] + lat_interval[<NUM_LIT:1>]) / <NUM_LIT:2><EOL>lon = (lon_interval[<NUM_LIT:0>] + lon_interval[<NUM_LIT:1>]) / <NUM_LIT:2><EOL>return lat, lon, lat_err, lon_err<EOL>
Decode the geohash to its exact values, including the error
margins of the result.  Returns four float values: latitude,
longitude, the plus/minus error for latitude (as a positive
number) and the plus/minus error for longitude (as a positive
number).