geo.geohashesInBBox
This function gives the geohashes of the cells that cover a closed box, with one precision. The list has each cell that has a point of the box one time, with the rule of `geohash` for a point on an edge. So a cell that touches the box only on the south edge or the west edge of the box is not in the list. A cell that touches the box only on the north edge or the east edge of the box is in the list. The order is from south to north, then from west to east. A box that crosses the antimeridian is correct.
CLI- Package
- @procedures/geo · README
- Path
["geo","geohashesInBBox"]- CLI
mark geo geohashesInBBox --box <object> --precision <number>- As data
{"$proc":["geo","geohashesInBBox"],"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","geohashesInBBox"], { box: {}, precision: 1 });
console.log(JSON.stringify(result));From the command line
$ mark geo geohashesInBBox --box <object> --precision <number>
As data, in a program
{
"$proc": ["geo", "geohashesInBBox"],
"input": { "box": {}, "precision": 1 }
}Input
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
box | object | yes | ||
precision | number | yes | The number of characters, from 1 to 12. | |
maxCells | number | no | The limit of the number of cells. It must not be `NaN` or less than 0. The default is `DEFAULT_MAX_GEOHASH_CELLS`. |
Output
The schema does not list fields (string[]).
JSON Schemas
{
"input": {
"type": "object",
"properties": {
"box": {
"type": "object",
"properties": {
"west": {
"type": "number"
},
"south": {
"type": "number"
},
"east": {
"type": "number"
},
"north": {
"type": "number"
}
},
"required": [
"west",
"south",
"east",
"north"
],
"additionalProperties": {}
},
"precision": {
"type": "number",
"description": "The number of characters, from 1 to 12."
},
"maxCells": {
"type": "number",
"description": "The limit of the number of cells. It must not be `NaN` or less than 0. The default is\n`DEFAULT_MAX_GEOHASH_CELLS`."
}
},
"required": [
"box",
"precision"
],
"additionalProperties": false
},
"output": {
"type": "array",
"items": {
"type": "string"
}
}
}