pyinterp.GeoHash

Contents

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__()

Get the state for serialization.

__repr__()

Get the string representation of this instance.

Inherited Methods

area(self[, wgs])

Return the area covered by this GeoHash.

bounding_box(self)

Return the bounding box of this GeoHash.

center(self)

Return the center point of this GeoHash.

error_with_precision([precision])

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

grid_properties(box[, precision])

Get the property of the grid covering the given box.

neighbors(self)

Return the eight neighbors of this GeoHash.

number_of_bits(self)

Return the number of bits of this GeoHash.

precision(self)

Return the precision of this GeoHash.

reduce(self)

Return the arguments to rebuild this instance.