Making sense of openstreetmap ski data

Some Opensnowmap.org services now rely on a smarter pistes search API than previously. It’s not replacing a Xapi or Overpass API, but is oriented toward a webservice that allows one to find what people usually calls a ‘ski piste’.

On Opensnowmap, there is less redundant search results when searching a piste by its name. It’s the same for pistes information and route description when you click on the map. Also, the search function is now a bit tolerant to typos.

A piste API ?

Well, it’s a big word for a python CGI making requests to a slightly modified pgsnapshot database.

Simplify search results

What happens if you search for a piste named ‘Pauvre Conche’ in openstreetmap data? You have 4 alpine pistes results: two easy ways, and two intermediate one. The new API then check if these ways touch each other, and if they share the same tags. If it is the case, they are concatenated. These give only two ‘pistes’ the blue one and the red one for ‘Pauvreconche‘.

Also, some pistes are mapped as ways, other as relations. There is even some people that map the pistes as both way and relation, both with the same name. Now the list of result can be filtered to remove the ways if they belong to a relation. This means that the piste ‘Le Vourbey’ can be found as a single result, omitting the way ‘Chemin de coupe le Vourbey’ part of the relation ‘LeVourbey’. However, if you use the routing feature of Opensnowmap, then the results will emphasize the way tags, but still show you that the way belong to a relation.

This will hopefully gives a user what he or she is looking for: a ski piste, not ways or relations.

Typos

This is easy: Postgres provides the module pg_trgm that does a pretty decent job.

Performance

Some burden in filtering the results have also been moved from the client(your browser) to the server. Also, geometries are sent as encoded polylines instead of wkt to reduce bandwidth consumption. Nevertheless, some filtering process can be long, so the API restrains itself to process only 50 OSM elements (ways and relations, before filtering) per request to ensure areasonable response time. So you won’t be able to find all the piste named’Loipe‘on Opensnowmap.org website. If needed you can add &limit=false to the query.

Premier mapping de la saison

C’est parti ! Ma première sortie hier m’a permis d’ajuster La Mathiez Sarrazin, sur le massif de la Haute-Joux. Une première boucle assez tranquille que j’ai mappé ‘novice’, puis une deuxième un peu plus vallonée ou ‘easy’, le tout avec un bon damage suites aux premières neiges conséquentes. La relation mappée en vert est un peu spéciale avec des passages communs à l’aller et au retour.

Ce domaine qui part de Vaux et va jusqu’à Cerniébaud est vraiment sympa, j’espère bien en compléter le mapping d’ici la fin de cet hiver. Et si quelqu’un complète avant moi, tant mieux !

Opensnowmap mobile version

Opensnowmap.org is now available in a mobile-friendlyversion.

mobileversion

The main navigation features have been integrated in this version.However, you won’t find the elevation profile and micro-routing functions. First, because it’s complicated, and then, because I did not find any example showing me this could make sense on a mobile screen.

The mobile version benefits from a ‘my location’ icon that will re-center the map on your location at a few second interval unless deactivated by the same icon. Hopefully, because I figured out that HTML5 geolocation implementation among browser and device seems a bit tricky unless you found the various settings allowing it. So, sorry in advance if you are welcomed by an alert popup: I hope this will help you to find whats wrong.

Technically, the server should redirect you on the proper version based on user-agent. You can then change to the desktop or mobile version from the menu. Your choice will be remembered in a cookie along with your langage preference(including Catalan users, thanks to Joan !).

This has been tested on various Android browsers, but I’m glad to receive feedback fom users on iOS, Windows phone or else.

Yves

Opensnowmap.org news

A few improvements had been put online recently:

  • Routing controls: intermediate points are now draggable. Double-click to delete.
  • Permalink with marker: accessible from the menu, a permalink with marker let’s you share a meeting point with your friends (example).
  • Resorts shown from zoom 5 (site=piste).
  • Relief layers on top of piste layer, to show the relief on pistes tagged asareas (Whistler).
  • Openlayer 2.13.1.
  • Replace Potlatch link with Id.
  • Minor interface changes.

Bug corrections:

  • HTML fix for ie8.
  • fix pistes ofsetter tool (example).

Improved ski routing

The routing function have been improved. Now the start and end points are theclosest point on the closest piste. Sound logical, but it wasn’t the casebefore.

This now means that you can take a lift at mid-slope, on Opensnowmap.orgwebsite, at least !

For those that did not knew the multi-modal (winter sports only) routing and pistes info capabilities of Opensnowmap.org, click on the the hand icon in the menu bar, zoom down to your favorite resort, and click on the pistes.

Note: Routing on Opensnowmap.org still rely on Pyroute. I had a test recently with Pgrouting 2.0.0 RC1, but did not end up with something worth it. I did not gave up yet.

Ski resorts: cool stuff with relation type=site

Relations type=site, site=pisteare used to map a ‘ski ressort’ or ‘skiing area’.

There are relations grouping all winter sport features that are member of a particular ressort. Their name is rendered at intermediate zoom on Opensnowmap.org.

Creating relations site=piste not only allows to render nice and meaningful names on the map at low zoom, but it also come in handy when your are looking for a piste.

Let’s say you are looking for a piste named ‘sapin’ (pine-tree in french). Not surprisingly, you will end up with a lot of results. However, now Opensnowmap.org gives you the results with a link to the resort name as taggedin the site=piste relation in which the piste is a member.

Handy, isn’t it ? Well, there is only a few relations like this rightnow. But the good news is that building these relations is just armchair mapping 😉

For this, I strongly suggest the use of JOSM on bigger ressorts. Use Opensnowmap.org tiles as a background and search for « piste:type »=* oraerialway=* , the rest is your local knowledge to add the proper name.

Opensnowmap on Android

Thanks to Osmdroid, it’s relatively easy to build a simple map application for Android, so here it is :

Opensnowmapapp on google play

It offers simple online map browsing and piste / place search by name. Ihope it is more convenient to browse ski trails than on your mobile browser,though I know that in the future I should provide a proper web-based mobile version of the site.

Be warned : this application is a paid-for one, and is mainly intended to support for server costs. It’s hard to find a good way to call for support, but I found this solution both practical for donations and useful. So, if you like Opensnowmap, don’t hesitate to give it atry.

Edit 2020: Outdated, the app is no longer available