pyinterp.GeoHash#

class pyinterp.GeoHash[source]#

Bases: GeoHash

Handle GeoHash encoded in base 32.

Geohashing is a geocoding method used to encode geographic coordinates (latitude and longitude) into a short string of digits and letters delineating an area on a map, which is called a cell, with varying resolutions. The more characters in the string, the more precise the location. The table below gives the correspondence between the number of characters, the size of the boxes of the grid at the equator and the total number of boxes.

precision

lng/lat (km)

samples

1

4950/4950

32

2

618.75/1237.50

1024

3

154.69/154.69

32768

4

19.34/38.67

1048576

5

4.83/4.83

33554432

6

0.60/1.21

1073741824

Geohashes use Base-32 alphabet encoding (characters can be 0 to 9 and A to Z, excl A, I, L and O).

The geohash is a compact way of representing a location, and is useful for storing a location in a database, or for indexing a location in a database.

Public Methods

from_string(code[, round])

Create from its string representation.

grid([box, precision])

Return the GeoHash grid covering the provided box.

Special Methods

__reduce__()

Helper for pickle.

__repr__()

Return repr(self).

Inherited Methods

area(self[, wgs])

Returns the area covered by this.

bounding_box(self)

Returns the bounding box of this GeoHash.

center(self)

Returns the center point of this GeoHash.

error_with_precision([precision])

Returns the accuracy in longitude/latitude and degrees for the given precision.

grid_properties(box[, precision])

Gets the property of the grid covering the given box.

neighbors(self)

Returns the eight neighbors of this GeoHash.

number_of_bits(self)

Returns the number of bits of this GeoHash.

precision(self)

Returns the precision of this GeoHash.

reduce(self)

Returns the arguments to rebuild this instance.