geomag 0.1.0+5

  • Readme
  • Changelog
  • Example
  • Installing
  • 64

geomag #

Translate GPS location data to geo-magnetic data such as magnetic declination.

The difference between true north and magnetic north is called magnetic declination. It is different everywhere on Earth and even changes over time. Every five years or so, a couple of governing bodies release coefficients data for calculating the magnetic declination at a given lat/lng and time.

[GeoMag] takes data from the World Magnetic Model Coefficients, [WmmCof], to initialize. You can provide your own or use the bundled data, WMM-2015v2 from 09/18/2018. Use [calculate()] to process GPS coordinates into a [GeoMagResult].

Accuracy is roughly within 0.2 degrees of test values.

See http://www.ngdc.noaa.gov/geomag/WMM/DoDWMM.shtml and https://www.ngdc.noaa.gov/geomag/WMM/wmm_rdownload.shtml.

This is a port of the geomagJS package, https://github.com/cmweiss/geomagJS.

Adapted from the geomagc software and World Magnetic Model of the NOAA Satellite and Information Service, National Geophysical Data Center.

screenshot.png

0.1.0+5 #

  • Add test and test results.

0.1.0 #

  • Initial version, ported from geomagJS

example/geomag_example.dart

import 'package:geomag/geomag.dart';

// See also the Flutter example: ...geomag/example/flutter

main(List<String> args) {
  final geomag = GeoMag();
  final result = geomag.calculate(double.parse(args[0]), double.parse(args[1]),
      double.parse(args.length > 2 ? args[2] : '0'));
  print('Result: $result');
  print('Declination: ${result.dec}');
}

Use this package as a library

1. Depend on it

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


dependencies:
  geomag: ^0.1.0+5

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:geomag/geomag.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
32
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
64
Learn more about scoring.

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

  • Dart: 2.5.1
  • pana: 0.12.21

Platforms

Detected platforms: Flutter, other

Primary library: package:geomag/geomag.dart with components: io.

Maintenance issues and suggestions

Support latest dependencies. (-10 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency (intl).

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.4.0 <3.0.0
intl ^0.15.8 0.15.8 0.16.0
meta ^1.1.6 1.1.7
Transitive dependencies
path 1.6.4
Dev dependencies
pedantic ^1.8.0+1
test ^1.6.5