geo.followsRightHandRule
This function gives `true` when the polygon follows the right-hand rule of RFC 7946 (section 3.1.6): each exterior ring is counterclockwise, and each hole is clockwise. A degenerate ring does not follow the rule.
CLI- Package
- @procedures/geo · README
- Path
["geo","followsRightHandRule"]- CLI
mark geo followsRightHandRule --polygon <object | object>- As data
{"$proc":["geo","followsRightHandRule"],"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","followsRightHandRule"], { polygon: "<polygon>" });
console.log(JSON.stringify(result));From the command line
$ mark geo followsRightHandRule --polygon <object | object>
As data, in a program
{
"$proc": ["geo", "followsRightHandRule"],
"input": { "polygon": "<polygon>" }
}Input
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
polygon | object | object | yes |
Output
The schema does not list fields (boolean).
JSON Schemas
{
"input": {
"type": "object",
"properties": {
"polygon": {
"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": {}
}
]
}
},
"required": [
"polygon"
],
"additionalProperties": false
},
"output": {
"type": "boolean"
}
}