As everybody of the Geoapify team loves skiing as well as snowboarding, we decided to create a demo map for Mapifator with ski resorts in the Alps. We intended to create a map that can help to choose a perfect place for the next ski vacation. Another goal was to find out how difficult is it to utilize OpenStreetMap data to create a thematic map with the Mapifator map builder.

In this article, we would like to share with you our experience, our conclusions, and recommendations, that can support you for making a custom map or extracting data from OSM.

Geodata and other data we decided to add to the map

After some discussions, we decided that a ski resorts map should have the following data to useful:

Ski lifts and ski slopes The interactive map should contain not only geometries and locations of lifts and slopes but also information about a ski resort size and infrastructure: length of slopes and amount of lifts. Elevation In the situation of Global Warming, a lot of ski resorts can’t guarantee snow. And it’s really sad! However, it becomes more and more important to have information about the altitude of ski resorts. Amenities Amenities are always nice to have! They may be not so important when you choose a ski resort. But become very helpful when you choose accommodation near the ski resort. Moreover, amenities can be used to make some suggestions about the ski resort. For example, the density of bars can tell you that the ski resort can be characterized as a party spot.

We decided to visualize on the map markings, restaurants, cafes, bars and toilets. We also added international airports near Alpin region. Media To make the map more alive and attractive we decided to add pictures and videos to ski resorts information. After some research, we made a choice in the direction of the Youtube Data API.

Mapifator map builder API to create custom thematic maps

We used a Mapifator map builder as a visualization tool. As we attended to add a big amount of places and complex geometries (lifts and slopes) we used Mapifator API to add data to the map.

As the goal was to create a thematic map that helps to make a decision toward the next ski vacation, we decided not to show each and every small resort but give an overview of the biggest ones. This is the result:

Getting geodata from OSM

In our previous article, we already described ways to extract data from OpenStreetMap. So the geodata we obtained from OSM with the help of Overpass API and Overpass Turbo.

It is worthwhile to mention that we reached a free version limits there very quickly and this inspired us to create our own instance. On another hand, we’ve found that Overpass API has performance problems on big values and complex queries. So we decided to run simple queries and process results with JavaScript after.

The first task was to identify ski resorts. After some analyses, we found that some of the ski resort areas have “landuse”=”winter_sports” tag, but a lot don’t. According to that we’ve chosen the following algorithm:

Step 1. Collect all ski lifts in the Alpin area

// getting ski lifts in the Alps overpass.queryData(`[out:json]; area(3602698607)->.alps; way ["aerialway"] ["aerialway"!="goods"] ["aerialway"!="zip_line"] (area.alps); out geom;`));

Step 2. Create ski lift clusters with ski lifts connected to each other

This was done with JS only. First, all lifts were represented as a separate cluster, then we combined clusters connected to each other.

Step 3. For each cluster (list of lifts) find slopes

Slopes we had to add recursively. First slopes connected to lifts, then other slopes connected to found slopes.

Here is an example of the Overpass API query (called from JS):

// getting slopes near ski lifts overpass.queryData(`[out:json]; way(id:${ids})->.lifts; way ["piste:type"="downhill"](around.lifts:100)->.pistes; .pistes out geom;`)); // getting slopes connected to existing slopes overpass.queryData(`[out:json]; way(id:${ids.join(',')})->.piste; way ["piste:type"="downhill"] ["area"!~".*"] ["landuse"!~".*"] (around.piste:10); out geom;`));

Step 4. Identify and combine clusters, that connected to each other with ski-slopes

Here we acted similarly to step 2.

Step 5. Add amenities to each separate ski resort

Amenities to searched nearby ski slopes. We queried all amenities to find out what options we have and filtered them by types later on:

// getting amenities overpass.queryData(`[out:json]; way(id:${ids.join(',')})->.piste; nwr["amenity"](around.pistes:100)->.amenities; .amenities out geom;`));

Getting elevation

To get maximum and minimum elevation values we queried top and bottom location for each lift. We used the Google Elevation API for that purpose. To all ski resorts that ascend 2000, 2500 and 3000 we added appropriate tags, so it possible to filter ski resorts on the resulting map.

Getting Youtube data

Youtube videos are great to embed. You do not need to take care of a license & copyrights. The Youtube player has all the required information. The Youtube Data API allows searching videos from a code.

However, the API has a quota which is calculated in some strange way. It happened to us that we could make only 70-80 requests per day per key.

Conclusions

How difficult is it to create a custom thematic map? It’s not! But takes time and requires some experience.

Data

Data is available! OpenStreetMap is only one option, but there are other ones. Of course, some analysis and post-processing are needed to unify data formats and extract only the data you need.

APIs

Almost all APIs have a free tier and usually, it’s enough to make requests required for the map creation.

Mapifator Map Builder

Even if we create it, we really enjoy using it! We believe that Mapifator has great perspectives! It allows creating custom maps at small costs. With a new Mapifator pricing policy 1 fully functional map is included in the Free plan.

Moreover, Mapifator API empowers users to add complex geometries and structured data.