From 5c6ee9e7821d0b550920048b95520ad5bb8b671f Mon Sep 17 00:00:00 2001 From: Ray Miller Date: Sat, 6 Jul 2024 15:11:53 +0100 Subject: [PATCH] Change default precision to 9 characters (approx 5m square) --- geohash.scm | 2 +- tests/geohash.scm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/geohash.scm b/geohash.scm index be1000c..1a03a73 100644 --- a/geohash.scm +++ b/geohash.scm @@ -10,7 +10,7 @@ (define base32 "0123456789bcdefghjkmnpqrstuvwxyz") -(define* (encode lat lon #:key (precision 6)) +(define* (encode lat lon #:key (precision 9)) (define desired-precision (min precision max-precision)) (let loop ((lat-min -90.0) (lat-max 90.0) diff --git a/tests/geohash.scm b/tests/geohash.scm index e3f3a2e..6954428 100644 --- a/tests/geohash.scm +++ b/tests/geohash.scm @@ -36,7 +36,7 @@ (encode 37.25 123.75 #:precision 12)) (test-equal "encode default precision" - "wy85bj" + "wy85bj0hb" (encode 37.25 123.75)) (test-end)