geo 0.2.4

  • Readme
  • Changelog
  • Example
  • Installing
  • 89

Dart Geo #

This project provides a set of utility functions for geographic computations.

You can:

  • compute distance between 2 points,
  • compute heading from one point to an other,
  • compute a point resulting from moving a distance from origin in the specified heading.
  • encode and decode a list of point according to the Encoded Polyline Algorithm Format.

License #

Apache 2.0

0.2.4 (2019-08-29) #

  • Add example.

0.2.3 (2019-08-29) #

  • Update CHANGELOG.

0.2.2 (2019-08-29) #

  • Improve README.

0.2.1 (2019-08-01) #

0.2.0 (2018-08-01) #

  • Migration to Dart 2.

0.1.0 #

  • no more range control for lat and lng in LatLng constructor. This is mainly to handle bounded boxes across antemeridian.

example/main.dart

import 'package:geo/geo.dart';

void computeDistance() {
  const p1 = LatLng(0, 0);
  const p2 = LatLng(3600, 3600);
  print(computeDistanceBetween(p1, p2));
}

void decodePath() {
  print(const PolylineCodec().decode('_p~iF~ps|U_ulLnnqC_mqNvxq`@'));
  // LatLng(38.5, -120.2),
  // LatLng(40.7, -120.95),
  // LatLng(43.252, -126.453),
}

void encodePath() {
  print(const PolylineCodec().encode(const [
    LatLng(38.5, -120.2),
    LatLng(40.7, -120.95),
    LatLng(43.252, -126.453),
  ]));
  // _p~iF~ps|U_ulLnnqC_mqNvxq`@
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  geo: ^0.2.4

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:geo/geo.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
78
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
89
Learn more about scoring.

We analyzed this package on Dec 7, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.1
  • pana: 0.12.21

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:geo/geo.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
meta ^1.1.7 1.1.8
Dev dependencies
test ^1.6.8