UNPKG

gis-tools-ts

Version:

A collection of geospatial tools primarily designed for WGS84, Web Mercator, and S2.

54 lines 1.57 kB
import type { BBox, MValue, Properties, VectorFeature, VectorPoint } from 's2json-spec'; import type { FeatureIterator, XMLTag } from '../../index.js'; export interface SVGProperties extends Properties { stroke?: string; strokeWidth?: string; fill?: string; } /** * # SVG Reader * * ## Description * * Reads data from an SVG string. The assumed projection is WGS84 * * Implements the {@link FeatureIterator} interface * * ## Usage * * ```ts * import { SVGReader } from 'gis-tools-ts'; * * const reader = new SVGReader('svg-text'); * * // read all the features * for await (const feature of reader) { * console.log(feature); * } * ``` * * ## Links * - <https://en.wikipedia.org/wiki/SVG> */ export declare class SVGReader implements FeatureIterator<Record<string, unknown>, MValue, SVGProperties> { #private; input: string; extent: BBox; features: VectorFeature<Record<string, unknown>, MValue, SVGProperties>[]; constructor(input: string); /** * Iterate over all features in the shapefile * @yields {VectorFeature} */ [Symbol.asyncIterator](): AsyncGenerator<VectorFeature<Record<string, unknown>, MValue, SVGProperties>>; } export interface SVGPath { d: string; stroke?: string; strokeWidth?: string; fill?: string; } export declare function pathsFromSVG(svg: string): SVGPath[]; export declare function pathFromSVG(path: string | XMLTag): SVGPath; export declare function getPointsFromSVGPath(d: string, extent: BBox): VectorPoint[]; //# sourceMappingURL=index.d.ts.map