Skip to content

jonamat/wikiloc-earth-layer

Repository files navigation

Wikiloc Google Earth layer

GitHub Workflow Status (branch) Uptime Robot status Uptime Robot ratio (7 days) GitHub go.mod Go version Docker Image Size (tag)



View Wikiloc.com trails in Google Earth.

Tiny http server written in Go that fetch trails from wikiloc.com to compose KML updates in the Google Earth view area.


Usage

Use demo server from Google Earth Pro

  • Download this KMZ file
  • Open Google Earth Pro, click File > Open and select the downloaded wikiloc-earth-layer.kmz
  • Navigate to the area you want to explore and wait for the trails
  • Enjoy your adventures!

Use locally from Google Earth online

You can't. Download Google Earth Pro.

Use locally from Google Earth Pro

  • Download & extract the last release from this page according to the target platform.
  • Run the binary ./bin/wikiloc-earth-layer (.exe)
  • Open Google Earth Pro, click File > Open and select the file stored in ./web/static/wikiloc-earth-layer.kmz
  • Navigate to the area you want to explore and wait for the trails
  • Enjoy your adventures!

Known issues

Slow or unresponsive service using remote KMZ

The service is currently hosted in an unscaled machine that has the computing power of a coffee maker. Each request to the server must handle up to 25 calls to wikiloc, involving geometric calculations and encoding/decoding operations for each of them, so it's easy that the server blown down with multiple users connected. Furthermore, an excessive amount of requests to the Wikiloc servers could trigger their rate limiters. If you want a decent lag, follow the Use locally from Google Earth Pro instructions to host the service yourself.

When camera is tilted, the resulting trails are far from the view area

Yep. When camera is tilted, the area you are exploring is the Lat-Lon point from the top right to the bottom left corner of the screen. Straighten your view to get a more precise result.

Tips and tricks

I recommend using the layer in combination with

Show measurements in imperial units
If you want to use imperial units, use the env var UNITS=imperial and restart the server

Development and contribution

The project is a suite of 3 software

  • get-icons to fetch the svg icon set from wikiloc.com and convert them to png
  • gen-kml to generate the init KML file which contains the network link for Google Earth
  • wikiloc-earth-layer is the http server that handle the updates from the network link

In the Makefile are defined the commands to run and build the source.
The project is set up to follow the guidelines of the Golang team that you can find here.

Build with Go

  • Install Go
  • Clone this repo
  • Go to the directory of the project with your terminal and type make build OR type:
    go build -o ./bin/wikiloc-earth-layer ./cmd/server/wikiloc-earth-layer.go
  • Wait for the build to finish
  • Now you can find the compiled binaries in ./bin/

Build with Docker

  • Install Docker
  • Clone this repo
  • Go to the directory of the project with your terminal and type make build-with-docker OR type:
    docker run --mount type=bind,source="$(pwd)"/target,target=/app golang:1.17.0-bullseye make build & make gen-kml & make get-icons & wait
  • Wait for the build to finish
  • Now you can find the compiled binaries in ./bin/

Working with dev containers

This repository provide all the tools to start writing and testing your code without any configuration.
To use devcontainer feature you need to have Docker installed and the Remote Containers extension enabled in VSCode.
See Developing inside a Container for details.

Licence

GNU GPLv3