TsGeo - Usage - Line length

There is an sample to compute a ellipsoid line length using TsGeo.

The Vincenty's formula is used.

import {Coordinate} from "tsgeo/Coordinate";
import {Vincenty}   from "tsgeo/Distance/Vincenty";

/* Add the following in a method of TS class */

let line = new Line(
    new Coordinate(52.5, 13.5),
    new Coordinate(52.6, 13.4)
);

console.log(line.getLength(new Vincenty())); // returns 13013.849

Back Polyline


Add a comment