geodesy 0.10.2 copy "geodesy: ^0.10.2" to clipboard
geodesy: ^0.10.2 copied to clipboard

A Dart library for geodesic and trigonometric calculations working with points and paths

example/README.md

Example #

Geodesy Class #

Check out full examples here.

import 'package:geodesy/geodesy.dart';

void main() {
  final Geodesy geodesy = Geodesy();
  List<LatLng> polygon = [
    const LatLng(0, 0),
    const LatLng(4, 0),
    const LatLng(4, 4),
    const LatLng(0, 4)
  ];
  LatLng centroid = geodesy.findPolygonCentroid(polygon);
  // Centroid: 2.0, 2.0
  print("Centroid: ${centroid.latitude}, ${centroid.longitude}");
}

Static Methods #

Check out full examples here.

import 'package:geodesy/geodesy.dart';

void main() {
  List<LatLng> polygon = [
    const LatLng(0, 0),
    const LatLng(4, 0),
    const LatLng(4, 4),
    const LatLng(0, 4)
  ];
  final LatLng centroid = PolygonCentroid.findPolygonCentroid(polygon);
  // Centroid: 2.0, 2.0
  print("Centroid: ${centroid.latitude}, ${centroid.longitude}");
}
55
likes
140
pub points
94%
popularity

Publisher

unverified uploader

A Dart library for geodesic and trigonometric calculations working with points and paths

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

latlong2

More

Packages that depend on geodesy