← All procedures
geo.fromPosition
This function gives the point of a GeoJSON position. It ignores the altitude. The longitude of the result is normalized.
CLI- Package
- @procedures/geo · README
- Path
["geo","fromPosition"]- CLI
mark geo fromPosition --position <number[]>- As data
{"$proc":["geo","fromPosition"],"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","fromPosition"], { position: [] });
console.log(JSON.stringify(result));From the command line
$ mark geo fromPosition --position <number[]>
As data, in a program
{ "$proc": ["geo", "fromPosition"], "input": { "position": [] } }Input
Output
JSON Schemas
{
"input": {
"type": "object",
"properties": {
"position": {
"type": "array",
"items": {
"type": "number"
}
}
},
"required": [
"position"
],
"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": {}
}
}