geohashtree 1.0.2 copy "geohashtree: ^1.0.2" to clipboard
geohashtree: ^1.0.2 copied to clipboard

GeohashTree is a tree implimentation to speed up spacial queries through geohash indexing.

example/main.dart

import 'package:geohashtree/geohashtree.dart';

void main() { 

  // initialize tree
  GeohashTree<String> tree = GeohashTree<String>(); 

  // add values to the tree
  tree.add("6g3mc", "iguazu"); 
  tree.addLatLng(-25.686667, -54.444722, "also iguazu");

  //update value 
  tree.update("6g3mc", (s)=>"iguazu_falls");  
  tree.updateLatLng(-25.686667, -54.444722, (s)=>"iguazu_falls");  

  //get value
  tree.getGeohash("6g3mc");

  //get all values and geohashes
  tree.geohashes;
  tree.values;

  //get all values in specific radius
  List<String> values = tree.getGeohashesByProximity(-25.686667, -54.444722,5000, precision: 9);
  print(values);

  //remove geohahs from the tree
  tree.remove("6g3mc");
  tree.removeWhere((geohash,value)=>geohash=="6g3mc");
  
}
0
likes
40
pub points
0%
popularity

Publisher

unverified uploader

GeohashTree is a tree implimentation to speed up spacial queries through geohash indexing.

Repository (GitHub)
View/report issues

License

Apache-2.0 (LICENSE)

Dependencies

dart_geohash, proximity_hash

More

Packages that depend on geohashtree