Coordinate.fromWKT constructor

Coordinate.fromWKT(
  1. String wkt
)

Creates a Coordinate from a WKT String.

Example:

Coordinate.fromWKT('1 2'); // Coordinate(1, 2)

Implementation

factory Coordinate.fromWKT(String wkt) {
  final coordinates = wkt.split(' ');
  return Coordinate(
      double.parse(coordinates[1]), double.parse(coordinates[0]));
}