Get hiking suggestions from your recorded tours
Colorful and in Color
To make the meta values of the printed tours more eye-catching later on, Listing 5 initially includes the fatih/color package from GitHub, which provides functions to output the ANSI color codes commonly used by terminals.
You can compile Listings 4 and 5 with the usual three-card trick (Listing 6). The resulting hikefind
binary either outputs all tours (Figure 5, without command-line options) or gives you a more compact selection using arbitrary combinations of the different filter types.
Listing 6
Compiling
$ go mod init hikefind $ go mod tidy $ go build hikefind.go csvread.go
Figure 6 shows all the hiking trails within 10 kilometers of my adopted hometown of San Francisco that climb less than 100 meters in elevation and can be completed in one hour or less. Only three routes remain – it's a pretty hilly city after all.
Infos
- "Go Retrieves GPS Data from the Komoot App" by Mike Schilli, Linux Magazine, issue 252, November 2021, https://www.linux-magazine.com/Issues/2021/252/Plan-Your-Hike/(language)/eng-US
« Previous 1 2 3
Buy this article as PDF
(incl. VAT)