Polygon<T extends Point<num> >.parse constructor
Polygon<T extends Point<num> >.parse (
- String text,
- PointFactory<
T> pointFactory, { - ParseCoordsListList? parser,
Create Polygon parsed from text
with a list of rings.
If parser
is null, then WKT text
like
"(40 15, 50 50, 15 45, 10 15, 40 15), (25 25, 25 40, 35 30, 25 25)"
is expected.
Throws FormatException if cannot parse.
Implementation
factory Polygon.parse(
String text,
PointFactory<T> pointFactory, {
ParseCoordsListList? parser,
}) =>
parser != null
? Polygon<T>.make(parser.call(text), pointFactory)
: parseWktPolygon<T>(text, pointFactory);