geo.circleMeters
This function gives a circle on the Earth as a polygon. The radius is a great-circle distance in metres. The module documentation gives the rules for the antimeridian and the poles.
CLI- Package
- @procedures/geo · README
- Path
["geo","circleMeters"]- CLI
mark geo circleMeters --center <object> --distance <number>- As data
{"$proc":["geo","circleMeters"],"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","circleMeters"], { center: {}, distance: 1 });
console.log(JSON.stringify(result));From the command line
$ mark geo circleMeters --center <object> --distance <number>
As data, in a program
{
"$proc": ["geo", "circleMeters"],
"input": { "center": {}, "distance": 1 }
}Input
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
center | object | yes | ||
distance | number | yes | The radius of the circle in metres, more than 0. | |
options | object | no | ||
radiusMeters | number | no | The radius of the sphere, more than 0. The default is `EARTH_MEAN_RADIUS_METERS`. |
Output
The schema does not list fields (object | object).
JSON Schemas
{
"input": {
"type": "object",
"properties": {
"center": {
"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": {}
},
"distance": {
"type": "number",
"description": "The radius of the circle in metres, more than 0."
},
"options": {
"type": "object",
"properties": {
"vertices": {
"type": "number",
"description": "The number of the vertices on the circle, an integer from 3 to `MAX_CIRCLE_VERTICES`. The default is `DEFAULT_CIRCLE_VERTICES`. More vertices give a polygon nearer to the circle."
}
},
"additionalProperties": {}
},
"radiusMeters": {
"type": "number",
"description": "The radius of the sphere, more than 0. The default is `EARTH_MEAN_RADIUS_METERS`."
}
},
"required": [
"center",
"distance"
],
"additionalProperties": false
},
"output": {
"anyOf": [
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "Polygon"
},
"coordinates": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": "array",
"items": [
{
"type": "number"
},
{
"type": "number"
},
{
"type": "number"
}
],
"additionalItems": {},
"minItems": 2
}
}
},
"bbox": {
"anyOf": [
{
"type": "array",
"items": [
{
"type": "number"
},
{
"type": "number"
},
{
"type": "number"
},
{
"type": "number"
}
],
"additionalItems": {},
"minItems": 4,
"maxItems": 4
},
{
"type": "array",
"items": [
{
"type": "number"
},
{
"type": "number"
},
{
"type": "number"
},
{
"type": "number"
},
{
"type": "number"
},
{
"type": "number"
}
],
"additionalItems": {},
"minItems": 6,
"maxItems": 6
}
],
"description": "The bounding box of the object (RFC 7946, section 5)."
}
},
"required": [
"type",
"coordinates"
],
"additionalProperties": {}
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "MultiPolygon"
},
"coordinates": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": "array",
"items": [
{
"type": "number"
},
{
"type": "number"
},
{
"type": "number"
}
],
"additionalItems": {},
"minItems": 2
}
}
}
},
"bbox": {
"anyOf": [
{
"type": "array",
"items": [
{
"type": "number"
},
{
"type": "number"
},
{
"type": "number"
},
{
"type": "number"
}
],
"additionalItems": {},
"minItems": 4,
"maxItems": 4
},
{
"type": "array",
"items": [
{
"type": "number"
},
{
"type": "number"
},
{
"type": "number"
},
{
"type": "number"
},
{
"type": "number"
},
{
"type": "number"
}
],
"additionalItems": {},
"minItems": 6,
"maxItems": 6
}
],
"description": "The bounding box of the object (RFC 7946, section 5)."
}
},
"required": [
"type",
"coordinates"
],
"additionalProperties": {}
}
]
}
}