Skip to main content

shapesToGeoJson

The shapes as a GeoJSON FeatureCollection, one feature each, with the shape's id, its name, its type and its area and length where they apply. A circle also carries radius_m and its centre, to two and six decimals, or exactly where its outline needed more than six decimals (a circle a few centimetres across). Only exportableShapes are included.

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

Signature​

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

function shapesToGeoJson(shapes: readonly DrawShape[]): FeatureCollection;

Description​

The numbers are the shape's own: JSON.stringify writes one under 1e-6 in exponent notation, so write the file with shapesToGeoJsonText.

Parameters​

  • shapes (readonly DrawShape[])

Returns​

FeatureCollection

See also​

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