← All procedures

geo.fromGeoJsonBBox

This function reads a GeoJSON bounding box of 4 or 6 numbers, with the rules of `parseGeoJson`. It examines the altitudes, and then it ignores them. It gives a box with longitudes from -180 to 180, with no rounding:

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

From the command line

$ mark geo fromGeoJsonBBox --bbox <number[]>

As data, in a program

{ "$proc": ["geo", "fromGeoJsonBBox"], "input": { "bbox": [] } }

Input

FieldTypeRequiredDefaultDescription
bboxnumber[]yes

Output

FieldTypeRequiredDefaultDescription
westnumberyes
southnumberyes
eastnumberyes
northnumberyes
JSON Schemas
{
  "input": {
    "type": "object",
    "properties": {
      "bbox": {
        "type": "array",
        "items": {
          "type": "number"
        }
      }
    },
    "required": [
      "bbox"
    ],
    "additionalProperties": false
  },
  "output": {
    "type": "object",
    "properties": {
      "west": {
        "type": "number"
      },
      "south": {
        "type": "number"
      },
      "east": {
        "type": "number"
      },
      "north": {
        "type": "number"
      }
    },
    "required": [
      "west",
      "south",
      "east",
      "north"
    ],
    "additionalProperties": {}
  }
}