从图中生成原理图(地理)图

发布于 2025-02-05 09:51:21 字数 576 浏览 3 评论 0 原文

我想知道如何最好地生成示意图,类似使用Python NetworkX库),其中包含每个节点(城市)的纬度和经度,以及在印度铁路网络中连接它们的线路。

  • 城市(节点)的位置应合理地靠近其实际位置,但不一定准确地定位。我可以使用 platecarrée投影,该投影只能将lat/long映射到图中的x/y上。
  • 铁路线(边缘)可以是直线,甚至可以曲线效果更好。
  • 该图应与每个行连接的线(最大4个字符)标签一起显示城市(最好用作点),每行的单个标签(给定的示例都有很长的标签,用于行)) 。
  • 最好将坐标的手动调整量最小化。

使用GraphViz是我的第一个想法。但是我不知道NEATO/FDP(节点的固定定位所需的)将使用大量节点/边缘执行。同样,将GraphViz显示标签在节点外(而不是直列)外分别制作,似乎需要每个标签的手动定位,这很无聊。有什么更好的方法可以获取这种布局吗?

I would like to know how best to generate a schematic diagram, something like this, from a graph (created using the Python NetworkX library) that contains the latitude and longitude of each node (city) and the lines connecting them in the Indian railway network.

  • The cities (nodes) should be located reasonably close to their actual position, but not necessarily exactly. I am OK with using the plate carrée projection that simply maps lat/long onto X/Y in the diagram.
  • The rail lines (edges) can be straight lines or even curves if it fits better.
  • On the diagram should be displayed the cities (preferably as dots) along with a short (max 4 characters) label for each, the lines connecting them, and a single label for each line (the given example has quite long labels for the lines).
  • Preferably the amount of manual tweaking of coordinates to get things to fit should be minimised.

Using Graphviz was my first idea. But I don't know how well neato/fdp (required for fixed positioning of nodes) will perform with large numbers of nodes/edges. Also, making Graphviz display labels separately outside the nodes (rather than inline) seems to need a lot of manual positioning of each label, which would be pretty boring. Is there any better way to get this kind of layout?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文