geohex 3.2.0+4
geohex: ^3.2.0+4 copied to clipboard

Dart implementation of Hexagonal geo-coding system (GeoHex.org) encoding.

GeoHex for Dart #

pub package Coverage Status Build Status

Implementation of GeoHex encoding for Dart language.

Usage #

Encoding example:

import 'package:geohex/geohex.dart';

main() {
  //Location of Capetown
  String geoHexCode = GeoHex.encode(-33.91522085, 18.3758784, 4); //OM4138
}

Decoding example:

import 'package:geohex/geohex.dart';

main() {
  //Geocode of Capetown
  Zone geoHexZone = GeoHex.decode('OM4138'); // instance of Zone with lat -33.91522085 lon 18.3758784 and level 4
}

Note #

This realisation has some difference with the original lib. It's location clamping. Original lib uses double representation of lat'n'lon, so theoretically, it should take more precision etc. but in fact, it leads to errors.

Refer to this - decimal degrees, eight points after dot the should be enough for everything.

0
likes
85
pub points
38%
popularity

Publisher

dart.tools

Dart implementation of Hexagonal geo-coding system (GeoHex.org) encoding.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

More

Packages that depend on geohex