geo_triangle_grid 1.1.1 copy "geo_triangle_grid: ^1.1.1" to clipboard
geo_triangle_grid: ^1.1.1 copied to clipboard

A package for creating a triangle grid on a map and converting them into hash for fast search.

example/geo_triangle_grid_example.dart

import 'package:geo_triangle_grid/geo_triangle_grid.dart';

void main() {
  latLngToHash();
  latLngToHashWithDepth();
  hashToLatLng();
}

void latLngToHash() {
  // Converting location into a triangle hash string
  final location = LatLng(37.7749, -122.4194);
  final hash = TriangleGrid.latLngToHash(location);
  print(hash);
}

void latLngToHashWithDepth() {
  // Converting location into a triangle hash string with a specific depth
  final location = LatLng(37.7749, -122.4194);
  final hash = TriangleGrid.latLngToHash(location, 12);
  print(hash);
}

void hashToLatLng() {
  // Converting triangle hash string into a location
  final hash = 'G110302102';
  final location = TriangleGrid.hashToLatLng(hash);
  print(location);
}
2
likes
160
points
42
downloads

Publisher

unverified uploader

Weekly Downloads

A package for creating a triangle grid on a map and converting them into hash for fast search.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

More

Packages that depend on geo_triangle_grid