среда, мая 05, 2021

Small Multiple Maps with OSM

I decided to make a birthday card today for a friend who is a big fan of motor sports and whose birthday happens to fall this year on the same day as the Spanish Grand Prix. I'm not overly pleased with the result (I'm no designer) but the process could be quite useful for creating small multiple posters. For example a poster showing the plans of all the Grand Prix circuits.

1. taginfo

OpenStreetMap is often the best source for geographical data. I didn't already know the tag used for motor racing circuits on OpenStreetMap. I therefore used taginfo to discover the correct tag (highway=raceway). As well as letting you find the tags used for geographic entities on OpenStreetMap taginfo also includes a link to query a tag on Overpass Turbo.

2. Overpass Turbo

If you click on the Overpass Turbo link on taginfo it will take you to Overpass Turbo with the correct query already written for you. In this case the query is:

[out:json][timeout:25];
// gather results
(
  // query part for: “highway=raceway”
  node["highway"="raceway"]({{bbox}});
  way["highway"="raceway"]({{bbox}});
  relation["highway"="raceway"]({{bbox}});
);
// print results
out body;
>;
out skel qt;

Go to the location of any motor racing circuit in the world in Overpass Turbo and run this query and you can download the GeoJSON data for the circuit.

3. GeoJSON.io

The data I downloaded of the Spanish Grand Prix circuit from Overpass Turbo included a number of other polylines which aren't related to the actual circuit used in the Grand Prix. I therefore needed to clean-up the data using GeoJSON.io

Opening the GeoJSON data in GeoJSON.io allows you to delete any polylines which you don't need. If you click on a line or polygon in GeoJSON.io you can just select the 'delete' option to remove the feature. I did this to remove all the track lines not associated with the Spanish Grand Prix track. I then saved the edited data as another GeoJSON file. 

4. Mapbox Studio

I uploaded my saved GeoJSON file of the Spanish Grand Prix track into Mapbox Studio. In Mapbox Studio you can view and style your geographical data. This allowed me to increase the size of the circuit line from 1px to 5px. In Mapbox Studio I was also able to hide all the other map layers to leave just my Spanish Grand Prix track on a white background (which I then copied and pasted into Photoshop).

 

This is how I created my Spanish Grand Prix birthday card. Now to complete a small multiple poster of all the 2021 Formula 1 Grand Prix circuits I just need to do this another 22 times to get the data of all 23 Grand Prix circuits in this year's season of races.

Комментариев нет: