# Algorithm or tool to design a worldwide subway transit map?

As the question says, an impossible (not earth) futuristic world has a subway system spanning across the entire planet and I would like to design its transit map. The obvious problem with doing this is the scale, as it would be way to large to draw by hand.

Just to be clear, I only want to design the transit map, not the actual metro system. You can assume a city-wide planet so population density and above ground stuff don't impact the map. In fact, it should look just like your everyday transit map but on a massive scale. Which I know wouldn't be useful, but I'm not going for realism here.

Unlike conventional maps, transit maps are usually not geographically accurate—instead they use straight lines and fixed angles, and often illustrate a fixed distance between stations, compressing those in the outer area of the system and expanding those close to the center.

The world's subway system is not defined, meaning there is nothing to base the schematic diagram on except the world's dimension. My planet is about the same as the earth, considering there might be a station every 1km that would make for a grid with a width of 40,075!

So, do you have any idea how to draw a giant transit map?

### So far, the research

Nathan Hellinga's Processing.py subway map generator resembles what I'm looking for and looks great ( but the algorithm wouldn't scale well to a very large grid.

Jannis Redmann's generating transit map theory bases itself on real world data. Maybe it could be used with generated data, but then the question remains on how to generate that data.

### My idea, a random walker

Basically, roll some dice and based on a predefined set of rules: go forward, place a station, turn... and repeat countless times until the map is filled.

*just to be clear, I'm looking to design a single giant transit map, preferably using some algorithm, and then tweak it manually to fit my world better.

• Comments are not for extended discussion; this conversation has been moved to chat. Commented Jan 9, 2020 at 1:08
• You could take a photo of a rubber band ball – it kind of looks like a subway map globe. :) ik.imagekit.io/ontimesupplies/oppictures/images/301450.JPG. If the system is designed and built from scratch, and the entire world has an even population density, then building on a grid system using latitude and longitude lines may make sense. Commented Jan 9, 2020 at 4:54
• xkcd.com/1196
– user6608
Commented Jan 9, 2020 at 7:19
• Are you looking for a rectangular map, or a spherical map, where the north part of the map is connected to the south part of the map, and the east and the west as well? Commented Jan 9, 2020 at 8:13
• @Halhex That would have been the appropriate answer to my original question. Commented Jan 9, 2020 at 15:07

## TL:DR: Make individual cities, connect in the appropriate manner

You want a global transit map for a global train system. That covers the system in all levels of detail. Alright, fine. But this map isn't going to be useful for most people, most days. After all, most of the time you just want either a specific city or the inter-city map.

And I think that's what you need to do in this case. You have individual cities connected by light rail or commuter rail, as its called, not subway lines with stops every few blocks.

Look at Baltimore: It only has one subway line, and one light rail line running across the city. But it is connected with a larger rail transit system.

(This picture is from http://www.urbanrail.net/, which has information on a lot of different subway systems. It might be a good resource for you.)

If there's urban sprawl to the point that stops are needed every few blocks for such a large distance (For example, Stellaris flavor text tells of a metropolitan area that stretched from Atlanta, Georgia, to Boston, Massachusetts) then it's likely the rail system comes from multiple subway systems kludged together.

So that's what you should do: make smaller systems and shove the ends of various lines together. Be sure to add more "beltway"-type lines around the edge of the edge, like the purple line in this image below:

Oh, and don't forget to add light rail connecting longer distances with fewer stops and faster speeds. These will probably connect hubs of the subway system. So while you can go from one edge of this metropolis to another just on the subway, the light rail will be faster. (But you'll probably need to take the subway on both ends if you just want to walk.)

• Well, I'll move these details at the top of the question. But I'm looking to create a transit map that would look just like those but on a massive scale, not designing a metro system that would be useful in connecting many cities together.
– Hugo
Commented Jan 8, 2020 at 18:51
• Not necessarily tru for Intercity to Intracity rail. D.C.'s Union Station isn't a Metro Hub and only has connecting service to the Red Line, which is the only line that does not share tracks in the city center. You can connect to the Green and Yellow Lines (same platform) two stops over and the Blue/Orange/Silver Lines (same platform as well) in another stop after that. Also the Purple Line is planned and not currently constructed. Commented Jan 8, 2020 at 19:31

Fractal generator?

I made this here. I tried to get one with 6 lobes, tweaking the variables but no luck... yet. http://usefuljs.net/fractals/

I used to have fractint on a pc. I whiled away many hours making fractals. The version I had let me map them to a globe. It is free now; here https://fractint.org/

You could make an organic-looking repeating pattern - like leaf veins or the alveoli of the lung, or the Julia set above, then map it to a sphere. If you are not starting from any particular topography a fractal will at least look cool, and it might suggest topology - for example I can imagine where the big stations would be in the above fractal.

• I'm not sure how I would modify this to make it look like a transit map though, but fractals are a good idea. I'll have to look more into this.
– Hugo
Commented Jan 8, 2020 at 18:27

You would need to consider how a worldwide subway system would get built, and how it would be used.

It wouldn't suddenly appear, fully completed. It would instead most likely develop over a long time, at first serving only the regions with highest population density or greatest need. Different parts of your world would get separate subway systems at different times. Gradually, the systems would expand further and further, eventually linking up with the neighbouring subway systems. New stations would be added where there is the need, while other areas would have stations much further apart and there might be long stretches of lines with no stations - for example under major bodies of water, mountain ranges, or through large automated industrial areas (as seen on Courusant).

If your planet has an active geology, you would need to think of a way to protect your subway from the effects of geological faults, earthquakes, volcanoes, and continental drift. It is likely your subway builders would try to avoid these areas altogether.

To make the system at all usable, you might need several levels of speed and frequency of stops. ie. express services and local services, maybe running on separate lines. The overall effect would be areas with a high density of lines and stations, while other areas would have a much lower density, perhaps with only express lines. Passengers would use express lines to get to a small selection of the stations in a local area before changing lines to get on the local services to get to their destination.

In terms of presenting this on a map, a worldwide subway map might need to present tens of millions of stations serving a population of ~2 trillion (based on the large cities with subway systems on Earth having ~200 stations serving ~10 million population, and Coruscant having a population of ~2 trillion). It is therefore unlikely that a full system map covering the entire planet would be useful for passengers, or even usable. Their most likely need would be a map covering their 'local' area, and perhaps a wider scale map just showing the regional centres around the planet that they can get to using express lines.

For this problem we have to create a bit of a history for your world. Remember that not all places are created equal.

# So you've got a planet wide city

But that doesn't mean it was always a planet wide city. It would once have been lots of individual cities that expanded until the boundaries blurred.

Your first level of the map is the connections between the transit hubs of these ancient cities. Each region would have had a capital with several hubs, major cities might have had two, smaller towns and cities only one. This remains as your long distance network. These hubs will consist of a long distance/high speed station, a metro station, and a bus station.

# Even major cities were once small towns and villages

If we consider a big old city like London, it's made up of dozens of smaller towns that were overrun to make the city. Each of those old towns has its town centre and high street. Many of those towns will need a local transit hub, this hub will consist of a metro station and a bus station. These will be points of higher density population even in a global city. In an ideally designed city these will be evenly spaced and everyone will be walking distance from one of them, but we're not creating an ideal city.

Will have multiple levels, planetary, "national", regional, local. The points on the map will pay attention to the distances between stops, but not to the route taken between them. Every step is a straight line. The other thing to note is that this will be one of the last parts of the map to build. First you need a full planetary city map, tied to that are the high density population points that become local transit hubs. From there you have the local bus maps that cover the gaps in the old metro networks that define your regional transport.

first, I would identify major population centers. like big cities, capitals, and more. I would say based on my own experience and no studies, generally like 10 per state, aka 10-15 per generally every 400 miles squared. so there will be many, MANY subway paths leading in and out of that. the other thing I would suggest is straight lines except for the occasional turns. the straighter the faster. just make it the opposite of g a y (don't worry I'm gay don't panic) and maybe link it to big cities. major population centers connecting to big cities connecting to small cities. you don't have to have subways connecting to EVERY city, because there is just a point where you could just walk there, instead of paying 50 dollars to go 4 miles. and again, make things as straight as possible. you can also have splits and crosses and more. the only problem then is crashes. if a train in a subway crashes then that has the ability to make an ENTIRE LINE fail. so maybe have options, or multiple train paths that go to the same place, and split off to smaller areas. maybe there could be jobs of people who guard the rails and report to emergencies and such to clean up and take care of things, and jobs where people go or drive a subway train to said places to take the ruined parts and recycle them to make more trains.

the other thing is water. oceans would be hard because well.. it gets pretty deep and if they puncture a hole then that's gonna collapse. if this civilization is purely underground and can't be above ground, then they will be forced to stay at their continent. springs and reservoirs exist and so do caves so that will be hard to deal with. it might be better to just go around everything, but that's a lot of everything. that'd be your decision.

that'd be how I'd do it.

Oh you want to just draw the map? Well, in that case I have another Idea depending on your programming skill. If I was tasked to do such things I would first precedurally generate a height map. Higher places on the map translate to a higher population density. Playing around with the parameters will give you a nice big map with different heights, just make sure to not have too many empty spaces but a good many medium places, since empty places on such maps are really small and medium spaces are the most frequent ones. This is relevant with the network, not every stop is connected with every stop, especially not further out.

Once the map has been created randomly create stops. The higher a stop is the more connections it has, from 1-6, but with 1 being very rare and only happening on the outside of cities.

Since cities might not always be close together/overseas, give every city one to three random knots depending on size of the city that are higher up and basically are long distance bus/train stations/airports.

If your world is one big city you can give the heightmap a minimum height that the smallest place is a suburb. But then where does growing crops/other things go? None of my concern,

This is what I would do. Definetly not the easiest way, but it can give the best results with the best chances of tweaking to your likely. I would not build from ground up: Check a random world generator like this and just take populated areas and do the thing with the knots suggested above, the higher the population the more knots there are. You'd just need to zoom in a lot

Edit: I just saw the comment of you not wanting to code a generator like this lel, well, my suggestion might just be a bit over the top so an easier approach.

Just do the random heightmap, with the same amount of dots everywhere. Give each dot an amount of connections to nearby knots, and give rules so it doesn't look like a cobweb but a subway plan. Or you just give them a random amount of connection and implement something like https://www.yworks.com/blog/automatic-metro-map-generation that makes metro maps from geographically accurate maps. Also look up mathematical graphs/trees. Because what you are doing here is basically creating one big graph

EDIT 2: The easiest solution with a bit of tweaking: random graph generator. Like this. then somehow feed it into this adn you're done. Edit 2.2. Also could look at a random city naming generator

NOTE: the last solution might give weird results with lots of loops. This is why i would advise you to remake the random graph generator to give rules like loops must not be smaller than 5 knots or something like that. Play around and find out. If you have questions that are about how to do this just comment. I can't teach you how to code, but for basic things you can just text me here maybe to stay on topic or ask stackoverflow.

• This is a good place to start. I could generate a heightmap and build a graph from that. I'm assuming the most common height would be very low since most metro stations are only on one line. Plus this would be easy to test on a small scale and scale up once I've figured out the values
– Hugo
Commented Jan 9, 2020 at 14:39
• Making that graph pretty afterward might be more of a challenge but that's okay, I saw a few algorithms online to do that.
– Hugo
Commented Jan 9, 2020 at 14:40
• The hightmap would detemine how many connections a node has. As in cities the city centers usually have buses and subways and many lines going the same routes etc, while on the outside there will be fewer connections. The second lik i posted that would make it pretty is not publicly available but you can email them about it and they could help you with this, be it give you the code or their ressources, i don't know. Good luck! Commented Jan 9, 2020 at 15:11
• Does this algorithm have a name? Is it inspired by a known algorithm? I somehow fail to find resources on graph generation
– Hugo
Commented Jan 9, 2020 at 15:46
• you can just look up graph generation. then just take that code and modify it. Note that everything will break because of the big amounts. RIP your RAM. It should be easier if every node just knows what node it is connected to, then you don't need a list of all of them and their connections Commented Jan 10, 2020 at 8:54

I have thought about your random walker - roll some dice and based on a predefined set of rules: go forward, place a station, turn... and repeat countless times until the map is filled.

You might me able to base it on an idea i saw using turtle logo

20 Random Walkers with List:

import turtle import random

screen = turtle.Screen() screen.setup(1000,1000) screen.tracer(0,0) walkers = list() n = 20 for i in range(n): walkers.append(turtle.Turtle()) for i in range(n): walkers[i].color((random.uniform(0,1), random.uniform(0,1), random.uniform(0,1)))

def random_walk(): for i in range(n): angle = random.randint(0,3)*90 walkers[i].seth(angle) walkers[i].fd(10) screen.update() screen.ontimer(random_walk,1000//20)

random_walk()

ps whilst browsing i did come across a company called yworks. That had used a yFiles diagramming library to automatically generate a metro map

https://www.yworks.com/blog/automatic-metro-map-generation

Since you edited your question to say I want to design only the transit map, not the actual metro system. You can assume a city-wide planet so population density and above ground stuff don't impact the map. In fact, it should look just like your everyday transit map but on a massive scale, the answer now boils down to draw it just like a metropolitan transit map, basically: just like how a local transit map is designed only moreso

• Metro Map Creator is a neat little transit map creator that allows you to draw standard type transit maps in a variety of colours using standard straight and 45deg angle lines.
• Metro Map Maker is another neat little transit map creator. You can get a little messier with line shapes on this one!

Both seem pretty intuitive to use and are free / online options. Here are a couple maps I just made in the last couple minutes. Both work very much like any simple drawing programme. MMM is very DC Metro style oriented, but it allows you to easily draw water features, islands, and parks. Both offer several station name orientations, though MMC only allows horizontal placement.

Metro Map Creator:

Metro Map Maker:

• This to me doesn't answer the question of how to draw the map. How is a local transit map designed? I don't understand the status quo section and can't use google earth on a planet that isn't earth.
– Hugo
Commented Jan 8, 2020 at 18:24
• @Halhex -- Maybe you need to ask a different question then? You seem to asking about a problem about a fictional world; but here you seem to be asking a more general map design question. I'm going to VTC until you can get some clarity as to what you want to know. Commented Jan 8, 2020 at 18:33
• I clarified the question a bit. does "I want to design only the transit map, not the actual metro system. You can assume a city-wide planet so population density and above ground stuff don't impact the map. In fact, it should look just like your everyday transit map but on a massive scale." make more sense to you? Also, obviously it wouldn't be useable if you're looking at it whole, just like with google Maps, the fictional people could zoom into it and stuff.
– Hugo
Commented Jan 8, 2020 at 18:36
• Right, well about the status quo: the real-life process to design transit map only really works on a small scale; I've drawn fictional transit maps leading to this but I can't spend years drawing a map this huge which is why I'm asking this question. About repeating your answer: the problem I see is that you're not answering the question, you're not saying how to design a transit map on a massive scale by saying to do the same as in real-life. But yes, I was agreeing with you there that zooming could be used, but the question isn't about using the map.
– Hugo
Commented Jan 8, 2020 at 18:48
• I do agree with @Halhex; this answer kinda feels like passing the buck, or writing a link-only answer. Folks reading this question in the future, as well as the OP, may be interested in doing something similar but have no idea how to do it even on a local level. A proper answer should really address that. Commented Jan 8, 2020 at 18:53

As you point out, a complete world subway map is not useful because it has too much information. Therefore, nobody will create one!

Any realistic transportation system will have a hierarchy for speed and efficiency. It is possible that all levels of the system are continuous worldwide, but useful maps will still only show a limited radius from your present location because travel any further than that should go up to the next level (transfer nodes highlighted), and the next level map is a different scale. Repeat for as many levels as needed.