Skip to main content

ShapeImport

What a file held: a refusal of the whole file, or the shapes that can be drawn with a count of those skipped for each reason and of the polygons whose holes were left out. A wkt-unreadable refusal, given when not one geometry in WKT text could be used (text in an SRID other than 4326 included), also carries the detail the WKT reader gave for the first fault: what was wrong, and where, as a message to format.

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

Signature​

import type { ShapeImport } from "@mapcairn/core";

type ShapeImport = {
readonly ok: false;
readonly refusal: ShapeImportRefusal;
readonly detail?: Message;
} | {
readonly ok: true;
readonly shapes: readonly DrawShapeInput[];
readonly skipped: Readonly<Partial<Record<ShapeImportSkip, number>>>;
readonly holesDropped: number;
};

See also​

Source: packages/core/src/draw/import.ts:90