pyinterp.geohash.encode

Contents

pyinterp.geohash.encode#

pyinterp.geohash.encode(lon: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]'], lat: Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]'], precision: SupportsInt = 12) numpy.ndarray#

Encode geographic coordinates into geohash strings.

This function encodes the given longitude and latitude coordinates into geohash strings with the specified precision.

Parameters:
  • lon – Longitudes in degrees.

  • lat – Latitudes in degrees.

  • precision – Number of characters used to encode the geohash code. Defaults to 12.

Returns:

Geohash codes as strings.

Raises:
  • ValueError – If the given precision is not within [1, 12].

  • ValueError – If the lon and lat vectors have different sizes.