Screenshot of the Route Elevation content block

The intent of this module is to render an elevation profile in form of a chart, retrieved by the GPX data of a file belonging to the node through Google Elevation API. And the map corresponding to the route, if desired.

Related Projects

This feature was asked many times and never provided in form of a simple, out of the box, working module. See e.g., #1914118, #55626, #2089185, #1894942.

In fact, the project Trackfield maintenance stopped to Drupal 6, while gpx field promoted as a project, doesn't support the rendering of a GPX without elevation.

I previously developed a solution involving a GPX parser which builds an elevation profile. Given that, in a common GPX file elevation, data is often not available, a runtime elevation retriever engine has been implemented exploiting an SRTM online knowledge base. This information is saved locally during either _file_presave or _node_presave. Finally an image is rendered when data is fully available.
This solution is heavy both from a bandwidth, storage and computational point of view. So, being Google APIs a turnkey solution, I choose to take advantage of them.

Usage

The module uses the Google Elevation API, taking into account its current limitations, in particular reducing the number of points to less than 512 (or the desired amount) locations per request.

For further information about module installation, licence and limitations, please refer to the README.txt file.

Notes

This module builds a legend with partial distances in X Axis and corresponding heights in Y Axis. Inside the code I provide a hack to retrieve the total distance from a Drupal field in the node, in case it is hand reported, as sometimes it happens.
This because, in such case, the calculated distance could be different and lead to a disparity with the legend.

Case Studies

This module is being used in the Sardegna Sentieri website.

Project information

Releases