Skip to content

59de44955ebd/OpenTopoGermany

Repository files navigation

OpenTopoGermany

The actual purpose of this repository is not the code of the little cross-platform demo app written in Python, but to provide the disk images listed below for download. The disk images contain raster tiles (.png) of OpenTopoMap and Lonvia cycling/hiking trail overlays for entire Germany up to zoom level 14 resp. 13. Those tiles are meant for usage in webview-based but offline applications, like e.g. a hiking (planning) app that also works when a user can't rely on a stable internet connection.

All disk images are raw ".img" (dd) images with a FAT32 filesystem and an additional VHD footer which also makes them valid .vhd files. Therefore they can be mounted easily both in Windows 10/11 and macOS simply by double-clicking them in Explorer resp. Finder (or by selecting "Mount..." from the context menu). Mounting via double-click also works in Desktop Linux if your have gnome-disk-image-mounter installed (Debian: sudo apt install gnome-disk-utility).

To make the disk images macOS- and Linux-compatible just remove the trailing ".vhd" from their filenames so that they have the extension ".img" instead. Neither Finder/hdiutil nor disk-image-mounter mind the additional VHD footer, they just ignore it.

Map/tile providers generally don't like users to mass download tiles from their servers, but sometimes you have no other choice if the provider doesn't offer a complete dump e.g. as .zip file. So that's the purpose of this repository, to reduce the load of those providers. In addition, given the overhead of HTTP requests, downloading a single large disk image file is surely much more efficient than downloading hundreds of thousands individual .png files, so this propably also saves energy/climate.

Tile disk images

Tiles up to zoom level 14

Tiles up to zoom level 13 (smaller but less details)

Convert to ISO/Joliet

If you prefer to use read-only .iso images instead of the original .vhd disk images, in Windows you can mount a .vhd image in Explorer and then run batch script make_iso.cmd. The batch script will ask you for the mounted .vhd's drive letter and then use provided MS utility OSCDIMG to create an ISO 9660/Joliet .iso image in the script's folder with the same contents as the original .vhd image.

Demo app

"Simple Offline Viewer" is a simple and lightweight demo desktop application written in Python and based on pywebview and Leaflet.

Its purpose is to demonstrate how those disk images can be used in a desktop app. The app scans all mounted (virtual) disks/volumes and looks for a "tiles" directory directly in their root directory. If found, a subdirectory called "otm" is used for the base layer and subdirectories called "cycling" and "hiking" for the overlay layers. Obviously this could easily be extended to support additional base and overlay layers provided by other mounted disk images.

For Windows and macOS standalone ("frozen") binaries (simple-offline-viewer.exe resp. simple-offline-viewer.app) are provided that don't depend on a local Python installation.

In Linux you need Python 3 and pywebview properly installed. The app might then be "installed" like this:

# For Linux:
$ git clone https://github.com/59de44955ebd/OpenTopoGermany
$ cd OpenTopoGermany
$ ln -s "$(realpath main.py)" ~/.local/bin/simple-offline-viewer

Usage:

  • Mount either the level 14 or level 13 otm disk image, and optionally also one or both corresponding trail overlay disk image(s).
  • Run simple-offline-viewer.
  • If you mounted a disk image after starting the application, select "Reload" from the webview's context menu to make the application aware of the new offline tile source.

Features:

  • View a topographic map of entire Germany without requiring an internet connection. This only requires the otm disk image to be mounted.
  • Toggle fullscreen mode with F11
  • If overlay disk images are mounted as well you can show/hide cycling and/or hiking trails using the control in the top right corner.
  • Distances can be measured using the measure control in the top left corner.
  • .gpx tracks can be loaded either by dropping them into the application window or clicking on the ".gpx" control.

Screenshots

Demo app "Simple Offline Viewer" in Windows 11

Demo app "Simple Offline Viewer" in macOS 13