diff --git a/internal/maps/olc.go b/internal/maps/olc.go deleted file mode 100644 index 938885faf..000000000 --- a/internal/maps/olc.go +++ /dev/null @@ -1,19 +0,0 @@ -package maps - -import olc "github.com/google/open-location-code/go" - -var OlcLength = 8 - -func OlcEncode(lat, lng float64) string { - if lat < -90 || lat > 90 { - log.Warnf("olc: latitude out of range (%f)", lat) - return "" - } - - if lng < -180 || lng > 180 { - log.Warnf("olc: longitude out of range (%f)", lng) - return "" - } - - return olc.Encode(lat, lng, OlcLength) -} diff --git a/internal/maps/olc_test.go b/internal/maps/olc_test.go deleted file mode 100644 index f37966647..000000000 --- a/internal/maps/olc_test.go +++ /dev/null @@ -1,30 +0,0 @@ -package maps - -import ( - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestOlcEncode(t *testing.T) { - t.Run("Wildgehege", func(t *testing.T) { - plusCode := OlcEncode(48.56344833333333, 8.996878333333333) - expected := "8FWCHX7W+" - - assert.Equal(t, expected, plusCode) - }) - - t.Run("LatOverflow", func(t *testing.T) { - plusCode := OlcEncode(548.56344833333333, 8.996878333333333) - expected := "" - - assert.Equal(t, expected, plusCode) - }) - - t.Run("LongOverflow", func(t *testing.T) { - plusCode := OlcEncode(48.56344833333333, 258.996878333333333) - expected := "" - - assert.Equal(t, expected, plusCode) - }) -}