utm 0.1.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 72

UTM dart #

Lat Lon and UTM bidirectional converter.
translate from Python UTM library

Support Geodetic System

  • WGS84 (default)
  • GRS80
  • Bessel

The UTM coordinate system is explained on this Wikipedia page.

Usage #

Simple usage.
Default geodetic system is WGS84

import 'package:utm/utm.dart';

final utm = UTM.fromLatLon(lat: -30, lon: -150);
print('zone: ${utm.zone}');
print('N: ${utm.northing}');
print('E: ${utm.easting}');
print('lat: ${utm.lat}');
print('lat: ${utm.lon}');

final latlon = UTM.fromUtm(
  easting: utm.easting,
  northing: utm.northing,
  zoneNumber: utm.zoneNumber,
  zoneLetter: utm.zoneLetter,
);
print('lat: ${latlon.lat}');
print('lon: ${latlon.lon}');

Use specific geodetic system

UTM.fromLatLon(lat: -30, lon: -150, type: GeodeticSystemType.bessel);
UTM.fromUtm(
  easting: utm.easting,
  northing: utm.northing,
  zoneNumber: utm.zoneNumber,
  zoneLetter: utm.zoneLetter,
  type: GeodeticSystemType.grs80,
);

Features and bugs #

Please file feature requests and bugs at the [issue tracker][tracker].

[tracker]:

0.0.1 #

  • Initial version, translate from Python library

0.0.2 #

  • Formatting and add comments

0.0.3 #

  • add description in pubspec.yaml

0.1.0 #

  • add arguments validator

0.1.1 #

  • down grade meta package. because Flutter dependency version 1.1.6 meta package

0.1.2 #

  • export UtmCoordinate

example/utm_example.dart

import 'package:utm/utm.dart';

main() {
  final utm = UTM.fromLatLon(lat: -30, lon: -150);
  print('zone: ${utm.zone}');
  print('N: ${utm.northing}');
  print('E: ${utm.easting}');
  print('lat: ${utm.lat}');
  print('lat: ${utm.lon}');

  final latlon = UTM.fromUtm(
    easting: utm.easting,
    northing: utm.northing,
    zoneNumber: utm.zoneNumber,
    zoneLetter: utm.zoneLetter,
  );
  print('lat: ${latlon.lat}');
  print('lon: ${latlon.lon}');

  UTM.fromLatLon(lat: -30, lon: -150, type: GeodeticSystemType.bessel);
  UTM.fromUtm(
    easting: utm.easting,
    northing: utm.northing,
    zoneNumber: utm.zoneNumber,
    zoneLetter: utm.zoneLetter,
    type: GeodeticSystemType.grs80,
  );
}

Use this package as a library

1. Depend on it

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


dependencies:
  utm: ^0.1.2

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:utm/utm.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
43
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]
72
Learn more about scoring.

We analyzed this package on Oct 23, 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, web, other

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

Health suggestions

Format lib/src/constants.dart.

Run dartfmt to format lib/src/constants.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.4.0 <3.0.0
angles ^1.2.1 1.2.1
meta ^1.1.6 1.1.7
Dev dependencies
pedantic ^1.7.0
test ^1.6.0