How could I generate a single transit map image , which is not based on any real map, on a massive scale? Are there algorithms or tools which could do something like this already?

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 scale I'm looking for is earth-like. If a line ran horizontally across it could have 40,075 stations kind of map. Ideally, It should also wrap around, like on a sphere.

I want it to look just like any local transit map (I'm basing myself on the Montreal metro map) which means I don't care about what a metro system of this scale should look like or how useless this would be.

So far, the research

  • 1
    \$\begingroup\$ What is your question? Are you in search of more resources similar to the one you listed? What tech stack are you working in, what have you implemented so far? How do you plan to represent and use the end product? Will it be simply an image like a normal subway map? Does it need to be wrapped around a globe in 3D space? Will the points on the map change dynamically or is it going to be a static? How do users interact with the map and in what kind of system/game/environment? \$\endgroup\$ – disc_code22 Jan 9 '20 at 15:11
  • \$\begingroup\$ Good point @disc_code22! I edited the question to make it a question. The technology doesn't matter to me but I have started testing the drawing side of this with Processing. It's an image so other than zooming everything is static, but yes it should wrap around. \$\endgroup\$ – Halhex Jan 9 '20 at 15:20

If the end goal is creating an algorithm which will give you a data structure roughly representing a transit map, perhaps controllable via parameters to like branching vs linearity, sprawl, number of lines, frequency of inter-line transfer stations, etc, I would begin by creating a mental model of what exactly is represented by a transit map, which I have hinted at already with some of the aforementioned parameters.

In terms of actual implementation of this model, I think a transit map can be most easily implemented as a tree, graph, or other network of linked elements.

To test the suitability of your own mental model I would recommend taking an existing real world transit map and trying to manually encode it in your proposed data structure to see if it fits well. You could even do this translation of real world transit map into data representation on paper or on a whiteboard. Tweak the model as needed.

At this point, having tested the viability of your data model, you should implement the actual generation algorithm. Keep the algorithm simple at first and expand the parameters and behavior after you can generate a basic proof of concept example transit map data.

After tweaking this generation algorithm you should have some suitable representation in data of a transit map which you can render in your engine/environment of your choice and figure out how users can best interact with it in a way that satisfies your requirements.

Overall this is a vague, procedure focused answer because the question itself has no specific code snippets or implementation details and as such I cannot comment concretely on any of these approaches. I think conceptually you have a firm grasp of the subject area and should try creating a prototype at this point. If it fails you can always go back to the drawing board and do more research, but I think you need to beware paralysis by analysis.

  • \$\begingroup\$ Well yes, transit maps can easily be represented as a graph. Maybe what I fail to ask properly is how do you generate a graph? Even knowing the variables, which I should formally define, I'm not sure where to start other than a random walker. \$\endgroup\$ – Halhex Jan 9 '20 at 15:43
  • \$\begingroup\$ The theoretical basics are covered in the wiki page on graphs as a data type. To simplify, the graph needs to hold a list of all nodes, each node holds a list of connected edges, and each edge knows which nodes it is connected to. Also, since you want to encode positional data the nodes should probably know their x/y coords. \$\endgroup\$ – disc_code22 Jan 9 '20 at 16:04
  • 1
    \$\begingroup\$ I hadn't looked at it in this way, thank you for taking the time! I think I'll beware paralysis by analysis as you said and do some small scale implementations this weekend \$\endgroup\$ – Halhex Jan 9 '20 at 16:28
  • 1
    \$\begingroup\$ Another thought, continuing from previous comment: I think the random walk is a good starting point for the initial state of the graph, kind of like the initial seed. By iteratively modifying this starting graph according to parameters controlled by queries as described above, you will ultimately get you a randomly seeded and generated graph that you conforms to a set of parameters (specified by logic of the queries and conditional modifications of graph). \$\endgroup\$ – disc_code22 Jan 9 '20 at 16:37
  • 1
    \$\begingroup\$ Yes! That's what I was thinking, and maybe if I can get a few good looking small scale maps I could look at their graph representations and reverse engineer a way to generate the graphs from there. \$\endgroup\$ – Halhex Jan 9 '20 at 16:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.