parser<T extends Point<num>> method

WktFactory<T> parser<T extends Point<num>>(
  1. PointFactory<T> point, [
  2. PointFactory<T>? pointWithM
])

Creates a WKT factory instace using the point factory.

An optional pointWithM factory can be given to instantiate any point objects with M coordinates.

Supported WKT geometry types: 'POINT', 'LINESTRING', 'POLYGON', 'MULTIPOINT', 'MULTILINESTRING', 'MULTIPOLYGON', 'GEOMETRYCOLLECTION'.

See Well-known text representation of geometry.

Implementation

WktFactory<T> parser<T extends Point>(
  PointFactory<T> point, [
  PointFactory<T>? pointWithM,
]) =>
    WktFactory<T>(
      pointFactory: ({required bool expectM}) =>
          expectM ? pointWithM ?? point : point,
    );