← All procedures

geo.decodeGeohash

This function gives the cell of a geohash: its edges and its center. Upper case letters are correct. Each character must be an ASCII digit or an ASCII letter.

CLI
Package
@procedures/geo · README
Path
["geo","decodeGeohash"]
CLI
mark geo decodeGeohash --hash <string>
As data
{"$proc":["geo","decodeGeohash"],"input":{}}

Use it

In TypeScript

import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/geo/register"; // registers its procedures

const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["geo","decodeGeohash"], { hash: "<hash>" });
console.log(JSON.stringify(result));

From the command line

$ mark geo decodeGeohash --hash <string>

As data, in a program

{ "$proc": ["geo", "decodeGeohash"], "input": { "hash": "<hash>" } }

Input

FieldTypeRequiredDefaultDescription
hashstringyes

Output

FieldTypeRequiredDefaultDescription
southnumberyes
westnumberyes
northnumberyes
eastnumberyes
centerobjectyes
JSON Schemas
{
  "input": {
    "type": "object",
    "properties": {
      "hash": {
        "type": "string"
      }
    },
    "required": [
      "hash"
    ],
    "additionalProperties": false
  },
  "output": {
    "type": "object",
    "properties": {
      "south": {
        "type": "number"
      },
      "west": {
        "type": "number"
      },
      "north": {
        "type": "number"
      },
      "east": {
        "type": "number"
      },
      "center": {
        "type": "object",
        "properties": {
          "lat": {
            "type": "number",
            "description": "The latitude in degrees, from -90 to 90."
          },
          "lon": {
            "type": "number",
            "description": "The longitude in degrees. A normalized longitude is from -180 to less than 180."
          }
        },
        "required": [
          "lat",
          "lon"
        ],
        "additionalProperties": {}
      }
    },
    "required": [
      "south",
      "west",
      "north",
      "east",
      "center"
    ],
    "additionalProperties": {}
  }
}