c2corg / c2corg/c2c_ui

Feature: Outings density map (heatmap + GPS tracks)

Open
#4,573 0 comments 0 reactions 1 assignee Claimed by @Nayor View on GitHub
enhancement
Dominant language
Vue
Stars
29
Forks
33
Avg merge
7m
Merged PRs (30d)
2

Description

## Context

This has come up repeatedly on the community forum, but was never tracked here:

- [Télécharger et/ou visualiser toutes les traces GPX de C2C](https://forum.camptocamp.org/t/telecharger-et-ou-visualiser-toutes-les-traces-gpx-de-c2c/249512) (2022) — request to see all outing GPX tracks on a map, colored by rating, to find routes in unfamiliar areas (especially ski touring). A moderator confirmed this wasn't possible at the time. Concerns raised: overlaying tracks on glaciers is risky since the terrain (crevasses) changes over time, and a single well-documented route is more useful than an unreadable pile of overlapping traces.
- [Sorties: cartes des traces GPS](https://forum.camptocamp.org/t/sorties-cartes-des-traces-gps/326095) (2024) — same request, explicitly inspired by skitour.fr, with filters by activity/rating/elevation gain/altitude/low-impact mobility. One reply pointed out that showing every GPX at once "is basically a heatmap" (*"ça fait plutôt heatmap"*) — but another objected that an all-tracks map is "a mess, a tangle of traces" (*"un foutoir, un écheveau de traces"*) with potentially dangerous errors.
- For reference: [skitour.fr's own heatmap](https://skitour.fr/forums/349402), compiled from ~10k Skitour + Camptocamp tracks, well received by that community. Camptocamp is only a data source there — no plan on their side for a C2C-native feature.

## Proposed approach

The recurring objection above is specifically about showing *all* individual tracks at once, which gets unreadable and can surface dangerous inaccuracies (e.g. outdated glacier routes). Rather than build that and roll it back, the design is zoom-dependent from the start:

- **Low/medium zoom**: an aggregated density heatmap (PostGIS grid aggregation via `ST_SnapToGrid`), filterable by activity. No individual tracks shown, so no readability/safety concerns from raw overlaps.
- **High zoom** (once the number of outings in the viewport is naturally bounded): individual outing tracks for the current viewport, still filterable by activity, fetched as a lightweight payload. Clicking a spot with several overlapping tracks opens a small picker (skitour-style) instead of navigating to one arbitrarily.

This also keeps both frontend and backend load bounded — the heatmap endpoint returns aggregated buckets (not raw outings), and the tracks endpoint is only ever called once the viewport is small enough to keep the result count under a fixed cap.

## Status

Implementation in progress on both repos:
- Backend: `c2corg/v6_api` branch [`feature/outings-heatmap`](https://github.com/c2corg/v6_api/tree/feature/outings-heatmap) — new `GET /outings/map/heatmap` and `GET /outings/map/tracks` endpoints, querying PostGIS directly.
- Frontend: `c2corg/c2c_ui` branch [`feature/outings-heatmap`](https://github.com/c2corg/c2c_ui/tree/feature/outings-heatmap) — new opt-in "outings density" layer toggle on the outings search map (off by default).

PRs to follow.

## Known gaps / possible follow-ups

- No color gradient by difficulty rating (requested in the 2022 thread) — not in scope for this first version.
- No staleness indicator on individual tracks (the 2022 thread's glacier/crevasse safety concern) — worth considering later.
- If a bbox stays too dense even at the high-zoom tier (e.g. Chamonix), a further evolution could be PostGIS vector tiles (`ST_AsMVT`) — not needed for v1.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.