← All procedures

geo.bboxOfPoints

This function gives the smallest bounding box of the points. A box crosses the antimeridian when that makes it narrower. For an empty array, the result is `undefined`.

CLI
Package
@procedures/geo · README
Path
["geo","bboxOfPoints"]
CLI
mark geo bboxOfPoints --points <object[]>
As data
{"$proc":["geo","bboxOfPoints"],"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","bboxOfPoints"], { points: [] });
console.log(JSON.stringify(result));

From the command line

$ mark geo bboxOfPoints --points <object[]>

As data, in a program

{ "$proc": ["geo", "bboxOfPoints"], "input": { "points": [] } }

Input

FieldTypeRequiredDefaultDescription
pointsobject[]yes

Output

The schema does not list fields (object | null).

JSON Schemas
{
  "input": {
    "type": "object",
    "properties": {
      "points": {
        "type": "array",
        "items": {
          "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": [
      "points"
    ],
    "additionalProperties": false
  },
  "output": {
    "anyOf": [
      {
        "type": "object",
        "properties": {
          "west": {
            "type": "number"
          },
          "south": {
            "type": "number"
          },
          "east": {
            "type": "number"
          },
          "north": {
            "type": "number"
          }
        },
        "required": [
          "west",
          "south",
          "east",
          "north"
        ],
        "additionalProperties": {}
      },
      {
        "type": "null"
      }
    ]
  }
}