Skip to main content

shapeGeometry

The GeoJSON geometry of a shape, or null when it is not valid. A circle is a polygon of 72 positions; coordinates are [longitude, latitude] rounded to six decimals (about 10 cm), or to the fewest more, up to ten, at which a small shape that six decimals would fold in on itself is valid again, as a circle with a radius of a metre or two is. A shape that not even ten decimals keep valid is written unrounded.

This is a function exported by @mapcairn/core, checked against version 0.2.0.

Signature​

import { shapeGeometry } from "@mapcairn/core";

function shapeGeometry(shape: DrawShape): Geometry | null;

Parameters​

  • shape (DrawShape)

Returns​

Geometry | null

See also​

Source: packages/core/src/draw/export.ts:150