measure library Null safety
A collection of measurement functions.
All measurements are in meters or square meters.
All measurements are in the EPSG:4326
coordinate system.
Functions
-
area(
Feature poly) → double - Calculates the area of a Polygon or MultiPolygon, in square meters. Also accessible from Polygon.area and MultiPolygon.area. The area is calculated using the Shoelace formula.
-
bearing(
Point from, Point to) → double - Computes the bearing between two Points. The bearing is the angle from the north to the second point.
-
distance(
Point from, Point to) → double - Computes the distance between two Points in meters. The distance is the straight-line distance between the two points. The distance is calculated using the Haversine formula.
-
length(
Feature line) → double - Calculates the length of a LineString or MultiLineString, in meters. Also accessible from LineString.length and MultiLineString.length. The length is calculated using the Haversine formula. Compare this snippet from lib/src/measure/length.dart: