← All procedures

geo.bboxCenter

This function gives the middle of a box. Its latitude is the middle of the latitudes of the box. Its longitude is the middle of the arc of longitudes from the west to the east. For a box that crosses the antimeridian, the middle is on the arc across the antimeridian.

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

From the command line

$ mark geo bboxCenter --box <object>

As data, in a program

{ "$proc": ["geo", "bboxCenter"], "input": { "box": {} } }

Input

FieldTypeRequiredDefaultDescription
boxobjectyes

Output

FieldTypeRequiredDefaultDescription
latnumberyesThe latitude in degrees, from -90 to 90.
lonnumberyesThe longitude in degrees. A normalized longitude is from -180 to less than 180.
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": {}
      }
    },
    "required": [
      "box"
    ],
    "additionalProperties": false
  },
  "output": {
    "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": {}
  }
}