← All procedures

geo.normalizeLon

This function gives the longitude in the range from -180 to less than 180. A longitude of 180 becomes -180, and -0 becomes 0. The result has no rounding: it is the longitude plus a multiple of 360. So the function does not change a longitude that is already in the range, other than -0.

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

From the command line

$ mark geo normalizeLon --lon <number>

As data, in a program

{ "$proc": ["geo", "normalizeLon"], "input": { "lon": 1 } }

Input

FieldTypeRequiredDefaultDescription
lonnumberyes

Output

The schema does not list fields (number).

JSON Schemas
{
  "input": {
    "type": "object",
    "properties": {
      "lon": {
        "type": "number"
      }
    },
    "required": [
      "lon"
    ],
    "additionalProperties": false
  },
  "output": {
    "type": "number"
  }
}