Why not just import a map?
The plan at the start was to generate the courses from OpenStreetMap: download the streets and buildings of a district, find a good loop and turn it into a race track. We wrote that importer, and it is in the repository with its own tests. But the build machine could not reach the OpenStreetMap servers, so the importer has only ever run against a made-up test town, never against real map data.
So every course in the game is drawn by hand. Each one starts from research notes on the real place: the order of the streets, which way they run, where the landmarks stand, how far apart things are. Then the lap is laid out as a series of control points in metres, with north always pointing the same way, and turned into a smooth road by the game's own spline code.
Squeezed, widened and sometimes moved
A real district is rarely a good race track as it is. A lap has to be between about 900 and 1,900 metres, corners must not be too tight for eight karts, and every street has to be widened to 12 to 18 metres. So almost every course is compressed: Marrakech is about three quarters of real size, the Muttrah Corniche about one eighth, and the jeep route across the Salar de Uyuni about one eightieth.
Some places are too spread out to fit at all, and those become composites. AlUla's sights lie along a valley about 25 kilometres long, so the lap strings them together and keeps their rough compass directions. Giza's Nile is really 8 kilometres from the pyramids and is pulled to about 300 metres. The Bimmah sinkhole is moved into the hills behind Muscat. Every one of these moves is written in the course's attribution, the line of text each track carries, and on its page on this website.
The real street stays real
Every World Tour course is built around at least one real road, kept in its real order: Avenue Mohammed V in Marrakech, Seventh Avenue through Times Square, Hermit Road along the Grand Canyon, the Milford Road through the Homer Tunnel, Atlanterhavsvegen in Norway. In the launch cities, a sign pops up with the street's name when you drive onto it, and tests check that each of those street sections is at least 350 metres of the lap.
The stunts, on the other hand, are openly invented. No real road leaves the rim of the Grand Canyon, the ferries in Istanbul do not let karts on board, and there is no glass tube under Doha's harbour. Every course page on this site separates the two: what is real, and what was added for the race.
Rules every course must pass
A course is not allowed into the game until a validator passes it. It checks that the road never folds over itself, that no building comes within the road and its shoulders, that boost pads sit on straights, that every jump has a straight run-up and room to land, and that every sacred place is at least 100 metres from the road (with two exceptions described in our post on the respect rules).
There are 12 launch circuits, 36 drop worlds that open through the tour and 10 arenas for the battle modes. The top-down maps on each course page are drawn straight from the same data the game uses.