Skip to content

3.0.0

Latest

Choose a tag to compare

@nh7a nh7a released this 03 Oct 22:38
· 1 commit to main since this release
468888e

Breaking

  • encode, adjacent and neighbors now return optionals and yield nil for invalid input instead of crashing or returning garbage, matching decode:
    • encode(latitude:longitude:length:) and encode(latitude:longitude:precision:) return String? (nil for a negative length, or a NaN, infinite or out-of-range coordinate).
    • CLLocationCoordinate2D.geohash(length:) and geohash(precision:) return String?.
    • adjacent(geohash:direction:) returns String? and neighbors(geohash:) returns [String]? (nil for an empty hash or a character outside the base32 alphabet).
  • adjacent returns nil instead of wrapping around when going north from the top row or south from the bottom row, and neighbors returns nil for cells that touch a pole. East and west still wrap around the antimeridian.
  • Renamed Precision.twoHundredFourtyCentimeters to twoHundredFortyCentimeters.

Fixes

  • decode returned a bogus box for some invalid input (for example "aaaaa" or an uppercase hash) instead of nil (#12).
  • encode is now linear in the hash length instead of quadratic (#15).

Other

  • Geohash.Direction and Geohash.Precision are Sendable.
  • Tests migrated to Swift Testing; removed the obsolete LinuxMain.swift and manifests (#14).
  • Removed dead code and a duplicated base32 alphabet (#16).