flutter_geo_hash 0.0.7 copy "flutter_geo_hash: ^0.0.7" to clipboard
flutter_geo_hash: ^0.0.7 copied to clipboard

Geohash encoding, decoding and neighbors, with Firestore geoquery bounds and distance helpers for Dart and Flutter. Compatible with Firebase geofire-common.

0.0.7 #

This release is backward compatible with 0.0.6: existing code keeps working, geohashes are unchanged, and query ranges only change where they used to miss results.

Added #

  • decodeGeoHash and decodeGeoHashBounds, which decode a geohash into the center or the bounds (GeoHashBounds) of its cell.
  • geoHashNeighbors, which returns the cells adjacent to a geohash, keyed by GeoHashDirection.
  • isValidGeoHash, which checks a geohash without throwing.
  • isWithinRadius, which filters query results using a radius in meters, the same unit as geohashQueryBounds.
  • GeoHashPoint.toString, which makes error messages show the coordinates instead of Instance of 'GeoPoint'.
  • Data for dart fix, which migrates code to the renamed classes.

Changed #

  • The package no longer depends on the Flutter SDK. It still works in Flutter apps, and can now also be used in any Dart project, such as a server.
  • Added explicit return types to log2, validateKey and validateLocation.
  • Documented the whole public API and rewrote the README, including a complete guide to querying Cloud Firestore by distance.
  • Added reference, property and regression tests, and continuous integration.

Deprecated #

  • MyGeoHash is renamed to GeoHashUtils, and GeoPoint to GeoHashPoint. The new names don't clash with the classes of other packages, such as GeoPoint in cloud_firestore. The old names still work as deprecated aliases, and will be removed in a future breaking release. Run dart fix --apply to migrate.

Fixed #

  • geohashQueryBounds missed locations within the radius when the search area reached towards a pole or spanned more than half of the globe's longitudes. Ranges for other queries are unchanged.
  • distanceBetween returned NaN for some nearly antipodal locations.
  • validateKey accepted keys containing ., #, $, /, [, ] or ASCII control characters, which the Firebase Realtime Database rejects. It now throws for them, as documented.
  • geohashQueryBounds threw an UnsupportedError for a negative, NaN or infinite radius. It now throws an ArgumentError describing the problem.

0.0.6 #

  • Removed the unused Flutter material import from the library.
  • Released the changes listed under 0.0.5.

0.0.5 #

This version was not published; its changes were released in 0.0.6.

  • Upgraded dart sdk version.
  • Removed android, iOS and web folders.
  • Fixes issues and solved warnings.
  • Added an example.
  • Added tests.

0.0.4 #

  • Wednesday, 11th August, 2021

0.0.3 #

  • Sunday, 20th June, 2021
10
likes
160
points
3.56k
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Geohash encoding, decoding and neighbors, with Firestore geoquery bounds and distance helpers for Dart and Flutter. Compatible with Firebase geofire-common.

Repository (GitHub)
View/report issues

Topics

#geohash #geolocation #firestore #firebase #maps

License

MIT (license)

More

Packages that depend on flutter_geo_hash