Skip to content
odinokovPublic

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hktrails

Live map Download all-in-one GPX Data Python Dependencies License

HK Trails map showing hiking routes across Hong Kong

325 GPX tracks covering Hong Kong's hiking trails, nature / country / fitness trails, heritage walks, cycle tracks, trail-race routes and the LCSD "Hiking Scheme" routes — plus waypoint layers for the 41 official AFCD campsites, the 143 highest peaks, 48 HKUA scuba dive sites, and 90 outdoor climbing & bouldering sites. Ships with gpx_inspector.py, a tiny standard-library tool to browse them on an interactive map with elevation profiles.

External links and data provenance: see Important notices.

Contents

hktrails/
├── maps/              # GPX tracks/routes + waypoint layers (campsites, peaks, dive sites, climbing)
├── docs/images/       # screenshot used by this README
├── gpx_inspector.py   # standard-library Leaflet/OSM inspector (works on any GPX)
├── index.html         # prebuilt standalone page — open directly, no server
├── LICENSE
└── README.md

Quick start

Open https://odinokov.github.io/hktrails in a browser — it's a fully self-contained page with all tracks embedded; no server, no install.

Or run the inspector live:

python3 gpx_inspector.py maps                 # serve ./maps at http://localhost:8000
python3 gpx_inspector.py maps --no-browser    # same, without opening a browser

It serves the directory and opens your browser at http://localhost:8000; pass --no-browser on a headless machine. Ctrl-C stops it.

Needs Python 3.8+ and nothing else — no pip install, no dependencies (tested on 3.8, 3.10, 3.11 and 3.12, which produce byte-identical output). Map tiles load from OpenStreetMap, so viewing needs internet; the GPX data itself is embedded in the page.

Using the GPX files

The .gpx files in maps/ import into any GPS app, watch or handheld. On Android we recommend AlpineQuest for offline maps + imported tracks/waypoints.

All-in-one GPX

Prefer a single import? hktrails_all.gpx bundles the entire collection into a single file:

Download hktrails_all.gpx

The inspector

gpx_inspector.py works on any GPX file or directory, not just this set:

  • Renders <trk> and <rte> as lines and <wpt> as markers.
  • Click a track for an elevation profile — distance, ascent/descent, min/max, with a hover probe and click-to-pin on the map. Tick smooth to apply Savitzky–Golay smoothing.
  • Filter by name, hover-to-highlight, collapsible sidebar (mobile-friendly).
  • Show my location (◉ button) displays your current position on the map.
  • Thins dense tracks with Ramer–Douglas–Peucker to keep the page light.
  • Lightweight standalone page: Embedded GPX data uses delta+quantized encoding.
python3 gpx_inspector.py track.gpx             # a single file
python3 gpx_inspector.py maps -p 8080          # custom port (default: 8000)
python3 gpx_inspector.py maps --no-browser     # don't open a browser
python3 gpx_inspector.py maps -o index.html    # rebuild the standalone page, then exit
python3 gpx_inspector.py maps --simplify 0     # keep every point (RDP off; default: 3 m)
python3 gpx_inspector.py maps --precision -1   # full coordinate precision (default: 6 dp)
python3 gpx_inspector.py --help                # all options

Elevation data

Track <ele> is sampled (bilinear) from the Hong Kong Lands Department 5 m grid LiDAR DTM (2010 + 2020 airborne surveys), heights in Hong Kong Principal Datum.

Important notices

Links to other websites. External links — including the Leisure and Cultural Services Department (LCSD), the Agriculture, Fisheries and Conservation Department (AFCD), the Hong Kong Underwater Association, Hiking Trail HK, hongkongclimbing.com, theCrag and Wikipedia — are provided for convenience only. No endorsement or affiliation is implied. This project does not control the content or availability of linked websites; refer to each site's own terms.

Derived data — not an official publication. The files in maps/ are derived works: geometry simplified (Ramer-Douglas-Peucker), every track elevation re-sampled from the Hong Kong Lands Department 5 m grid LiDAR DTM. They are not the original files published by any source, are not an official publication of any government department, and are provided without warranty. Every file records its own source in its GPX <metadata> and <trk><src>.

Links inside the GPX files. Files in maps/, and the all-in-one bundle, carry <link> elements pointing at the pages they were compiled from; a GPS app may render these as tappable links. They are provided for convenience only, on the same terms as above.

Third-party requests on the map page. The map page loads tiles from OpenStreetMap and its map library from a public CDN, and uses Google Analytics (GA4); those operators receive your IP address under their own privacy policies. The project itself collects no personal particulars.

Corrections and removal. Rights holders and data sources who consider that anything here should be corrected, attributed differently or removed may open an issue at https://github.com/odinokov/hktrails/issues; it will be actioned promptly.

License and data provenance

This repository is split-licensed. No single license applies to every file or datum.

  • Repository-authored material — CC0 1.0 Universal. This includes gpx_inspector.py, documentation, UI code, and other original contributions to the extent the repository author owns the relevant rights.
  • Hiking Trail HK-derived trail data — ODbL 1.0, derived from hikingtrailhk.appspot.com. ODbL attribution, notice, and share-alike requirements continue to apply.
  • Elevation values — derived from the Hong Kong Lands Department 5 m grid LiDAR DTM distributed through DATA.GOV.HK. Applicable DATA.GOV.HK source-attribution requirements remain in force.
  • LCSD "Hiking Scheme" routes — sourced from the LCSD GPX download area. LCSD-derived material is not relicensed by this repository; LCSD's own copyright terms apply.
  • Campsites — data from the Agriculture, Fisheries and Conservation Department campsite listing; source terms remain applicable.
  • Peaks — sourced from Wikipedia: mountains, peaks and hills in Hong Kong; applicable Wikipedia/Wikimedia licensing remains in force.
  • Scuba sites — data from the Hong Kong Underwater Association dive-site guide; source rights remain applicable.
  • Climbing & bouldering sites — compiled from hongkongclimbing.com and theCrag; source rights remain applicable.

Generated or combined files such as index.html and hktrails_all.gpx may contain material from several of these classes. Their components retain their underlying licensing and attribution requirements; the whole file should not be treated as entirely CC0.

See LICENSE for the detailed licensing and provenance notice.

Disclaimer

This data is provided as-is, without warranty of any kind, for general reference only. Waypoints may be inaccurate or mark an approach point rather than the feature itself; trails, crags and access arrangements change. Hiking, climbing and diving could be dangerous — verify conditions and access on the ground, use up-to-date guidebooks, and proceed at your own risk.