跳转至

Convert GeoPoint to Geohash(将 GeoPoint 转换为 Geohash)

Supported in: Batch, Faster, Streaming

Converts a GeoPoint to a base32-encoded Geohash with specified precision that contains the GeoPoint. For more information on Geohash, see: https://en.wikipedia.org/wiki/Geohash .

Expression categories: Geospatial

Declared arguments

  • GeoPoint: The GeoPoint to convert.
    Expression\
  • Output Geohash precision: The number of base32 characters returned in the output Geohash string.
    Expression\

Output type: Geohash

Examples

Example 1: Base case

Argument values:

  • GeoPoint: point
  • Output Geohash precision: 5
point Output
{
latitude: -20.0,
longitude: 80.0,
}
mu2yh
{
latitude: -77.0599,
longitude: 38.9031,
}
hf79t
null null

Example 2: Base case

Argument values:

  • GeoPoint: point
  • Output Geohash precision: precision
point precision Output
{
latitude: -20.0,
longitude: 80.0,
}
5 mu2yh
{
latitude: -77.0599,
longitude: 38.9031,
}
3 hf7
{
latitude: -82.77450568,
longitude: -179.55742495,
}
12 0123456789zb
{
latitude: 1.0,
longitude: -1.0,
}
12 ebpm9npc6m9b
{
latitude: 1.0,
longitude: -1.0,
}
null null


中文翻译

将 GeoPoint 转换为 Geohash

支持:批处理(Batch)、快速处理(Faster)、流处理(Streaming)

将 GeoPoint 转换为指定精度的 base32 编码 Geohash,该 Geohash 包含该 GeoPoint。有关 Geohash 的更多信息,请参阅:https://en.wikipedia.org/wiki/Geohash 。

表达式类别: 地理空间(Geospatial)

声明的参数

  • GeoPoint: 要转换的 GeoPoint。
    表达式\
  • 输出 Geohash 精度: 输出 Geohash 字符串中返回的 base32 字符数量。
    表达式\

输出类型: Geohash

示例

示例 1:基本情况

参数值:

  • GeoPoint: point
  • 输出 Geohash 精度: 5
point 输出
{
latitude: -20.0,
longitude: 80.0,
}
mu2yh
{
latitude: -77.0599,
longitude: 38.9031,
}
hf79t
null null

示例 2:基本情况

参数值:

  • GeoPoint: point
  • 输出 Geohash 精度: precision
point precision 输出
{
latitude: -20.0,
longitude: 80.0,
}
5 mu2yh
{
latitude: -77.0599,
longitude: 38.9031,
}
3 hf7
{
latitude: -82.77450568,
longitude: -179.55742495,
}
12 0123456789zb
{
latitude: 1.0,
longitude: -1.0,
}
12 ebpm9npc6m9b
{
latitude: 1.0,
longitude: -1.0,
}
null null