latlong_to_osgrid 1.3.3 copy "latlong_to_osgrid: ^1.3.3" to clipboard
latlong_to_osgrid: ^1.3.3 copied to clipboard

A dart package to translate given latitude and longitude coordinates into an 12 digit OS Grid Reference and vice versa.

example/main.dart

import '../lib/latlong_to_osgrid.dart';

class ExampleClass {
  LatLongConverter converter = new LatLongConverter();

  void OSGBfromDecExample(double lat, double long) {
    OSRef result = converter.getOSGBfromDec(lat, long);
    print("${result.easting} ${result.northing}");
  }

  void OSGBfromDmsExample(var latDeg, var latMin, var latSec, var longDeg, var longMin, var longSec) {
    OSRef result = converter.getOSGBfromDms(latDeg, latMin, latSec, longDeg, longMin, longSec);
    print("${result.easting} ${result.northing}");
  }

  void LatLongfromOSGBExample(var easting, var northing) {
    LatLong result = converter.getLatLongFromOSGB(easting, northing);
    print("${result.lat} ${result.long}");
  }

  void DecimalToDmsExample(double lat, double long) {
    var latDms = converter.getDegreeFromDecimal(lat);
    var longDms = converter.getDegreeFromDecimal(long);
    print("${latDms[0]}° ${latDms[1]}' ${latDms[2]}\"");
    print("${longDms[0]}° ${longDms[1]}' ${longDms[2]}\"");
  }

  void DmsToDecimalExample(var latDeg, var latMin, var latSec, var longDeg, var longMin, var longSec) {
    var latDec = converter.getDecimalFromDegree(latDeg, latMin, latSec);
    var longDec = converter.getDecimalFromDegree(longDeg, longMin, longSec);
    print("$latDec $longDec");
  }

}
6
likes
120
pub points
81%
popularity

Publisher

verified publisherfunkypenguin.dev

A dart package to translate given latitude and longitude coordinates into an 12 digit OS Grid Reference and vice versa.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

pedantic, test, vector_math

More

Packages that depend on latlong_to_osgrid