From e8d32d8817c8b0478e4d7f75dfbec5c500689b12 Mon Sep 17 00:00:00 2001 From: Timo Schwarz Date: Thu, 24 Dec 2020 12:28:31 +0100 Subject: [PATCH 1/2] Update simplemap.go Fix incorrect "ok" evaluation --- storage/simplemap.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/simplemap.go b/storage/simplemap.go index cf4476f..c53a3a2 100644 --- a/storage/simplemap.go +++ b/storage/simplemap.go @@ -14,7 +14,7 @@ func NewSimpleMap() SimpleMap { // Get returns a the key associated with a coordinate, or the func (s SimpleMap) Get(key coordinate.Interface) (interface{}, bool) { - if _, ok := s[key]; ok { + if _, ok := s[key]; !ok { return nil, false } From a4ba82da832b639c05ce444324d63889c572d5c5 Mon Sep 17 00:00:00 2001 From: Timo Schwarz Date: Thu, 24 Dec 2020 12:29:57 +0100 Subject: [PATCH 2/2] Update geostorage.go Unused variable prevents compilation also fixed typo --- storage/geostorage.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/geostorage.go b/storage/geostorage.go index bfb94b0..ee9451d 100644 --- a/storage/geostorage.go +++ b/storage/geostorage.go @@ -34,7 +34,7 @@ func (g *GeoStorage) AxialFromGeo(latitude, longitude float64) coordinate.Axial // would i fly around the world with this - no. But for a square mile it should be fine. latitudeDifference := latitude - g.lat - longitudeDiffernece := longitude - g.lon + // longitudeDifference := longitude - g.lon verticalOffset := 111131.77741377673104 / math.Pow(1+0.0033584313098335197297*math.Cos(2*latitudeDifference), 1.5) horizontalOffset := 111506.26354049367285 * math.Cos(latitudeDifference) / math.Pow(1+0.0033584313098335197297*math.Cos(2*latitudeDifference), 0.5)