\documentclass[tikz]{standalone}

\usepackage{tikz}
\usepackage{fontspec}
\usepackage{contour}

\ExplSyntaxOn
\cs_new_eq:NN \strcaseOTF \str_case:onTF
\cs_new_eq:NN \strifeqOTF \str_if_eq:onTF
\cs_new_eq:NN \strreplace \tl_replace_all:Nnn
\cs_new_eq:NN \strset \str_set:Nn
\cs_new_eq:NN \tlset \tl_set:Nn
\cs_new_eq:NN \tlreplace \tl_replace_all:Nnn
\cs_new_eq:NN \tlremove \tl_remove_all:Nn
\cs_new_eq:NN \tlremoveone \tl_remove_one:Nn
\cs_new_eq:NN \tlputleft \tl_put_left:Nn
\cs_new_eq:NN \tlputright \tl_put_right:Nn

\cs_new_eq:NN \seqsetsplit \seq_set_split:Nne
\cs_new_eq:NN \seqMapInline \seq_set_map:NNn
\cs_new_eq:NN \seqPopRight \seq_pop_right:NN
\cs_new_eq:NN \seqUse \seq_use:Nn
\cs_new_eq:NN \seqshow \seq_show:N


% scratch space for multi-line labels later
\seq_new:N \nodeseq
\seq_new:N \temp
\ExplSyntaxOff
\usepackage{pgfplots}

\setmainfont{Atkinson Hyperlegible}
\usetikzlibrary{shapes.geometric}
\usetikzlibrary{calc}
\usetikzlibrary{positioning}
\usetikzlibrary{arrows.meta}

\definecolor{one}{RGB}{243,155,154}
\definecolor{two}{RGB}{176,0,68}
\definecolor{three}{RGB}{213,173,0}
\definecolor{four}{RGB}{247,171,99}
\definecolor{five}{RGB}{0,150,94}
\definecolor{seven}{RGB}{135,204,0}
\definecolor{nine}{RGB}{149,107,37}
\definecolor{ten}{RGB}{166,15,128}
\definecolor{twelve}{RGB}{94,107,175}
\definecolor{fourteen}{RGB}{228,142,0}
\definecolor{fifteen}{RGB}{225,117,0}
\definecolor{sixteen}{RGB}{147,194,59}
\definecolor{nineteen}{RGB}{227,0,11}
\definecolor{twentyfour}{RGB}{33,195,100}
\definecolor{twentyseven}{RGB}{140,29,117}
\definecolor{thirtyone}{RGB}{243,155,154}
\definecolor{thirtythree}{RGB}{94,107,175}

\input{../shapes.tex}

\pgfdeclarelayer{bg}
\pgfdeclarelayer{lines}
\pgfdeclarelayer{stops}
\pgfdeclarelayer{labels}
\pgfdeclarelayer{legend}
\pgfsetlayers{bg,lines,stops,labels,main,legend}

\contourlength{.2ex}


\def\labelContour#1{%
    \seqsetsplit\nodeseq{ |}{#1}%
    \seqMapInline\temp\nodeseq{\contour{white}{##1}}%
    \seqUse\temp{\\}
}

\def\mlabel(#1, #2, #3, #4, #5)#6{
    \tlset\nodename{#6}
    \tlremove\nodename{|}
    \node[label, align=center, anchor=#2, rotate=#3] at ($(\nodename.#1) + (#4:#5)$)
     {\labelContour{#6}};
}
\def\slabel(#1, #2)#3{\mlabel(#1, #2, 0, 0, 0){#3}}

\begin{document}

\begin{tikzpicture}[
    railway line/.style = {
      color=gray,
      line width=0.075cm,
      rounded corners=0.5cm,
    },
    railway/.style = {
      railway line,
      {Latex[length=5mm]}-{Latex[length=5mm]},
    },
    railway outwards/.style = {
      railway line,
      -{Latex[length=5mm]},
    },
    stop/.style = {
      black,
      rounded corners=0.1cm,
      line width=0.05cm,
      fill=white,
      draw,
      shape=stop,
      anchor=center,
      minimum height=0.2cm,
    },
    stop1/.style = {
      stop,
      minimum width=0.2cm,
    },
    stop2/.style = {
      stop,
      minimum width=0.4cm,
    },
    stop3/.style = {
      stop,
      minimum width=0.6cm,
    },
    stop4/.style = {
      stop,
      minimum width=0.8cm,
    },
    stop5/.style = {
      stop,
      minimum width=1.0cm,
    },
    stop6/.style = {
      stop,
      minimum width=1.2cm,
    },
    stop7/.style = {
      stop,
      minimum width=1.4cm,
    },
    line/.style = {
      line width=0.15cm,
      rounded corners=0.1cm,
    },
    help line/.style = {
      line width=0.05cm,
    },
    label/.style = {
      black,
      font=\scriptsize,
      align=center,
    },
    line name/.style = {
      label,
      color=white,
      minimum width=1em,
      minimum height=1em,
      inner sep=0pt,
      outer sep=.7em,
    },
  ]

  % movable circle line
  \newcommand{\polar}[1]{($#1 + (0,.5)$)}
  \def\rad{6}

  \def\centerarc(#1:#2:#3)
    { ($(0,.5) + ({#3*cos(#1)},{#3*sin(#1)})$) arc (#1:#2:#3) }


  \begin{pgfonlayer}{stops}
    \pgfmathsetmacro{\offset}{0.1*tan(45/2)}

    % core stations
    \node[stop4, rotate=35] (Lega Lombarda) at (-.7,4.4) {};
    \node[stop4, rotate=35] (Arena) at (-0.2,3.7) {};
    \node[stop4] (Lanza) at (0,3) {};
    \node[stop4] (Cusani) at (0,2) {};
    \node[stop6, below=1 of Cusani.east, anchor=east] (Cordusio) {};

    \node[stop2, below=1 of Cordusio.four eighth, anchor=one half] (DuomoN) {};
    \node[stop4, below=.6 of DuomoN.one half, anchor=one half] (Duomo) {};
    \draw[stop]
      ($(DuomoN.two half)+(90:0.1)+(0:0.1)$)
    -- ++(-.4,0)
    -- ++(0,-.8)
    -- ++(.8,0)
    -- ++(0,.2)
    -- ++(-.4,0)
    -- ++(0,.4)
    -- cycle
    ;

    % left side
    \node[stop2, rotate=90, left=1.2 of Cordusio.center, anchor=one half] (Via Meravigli) {};
    \node[stop2, rotate=90, left=2.4 of Cordusio.center, anchor=one half] (Largo d'Ancona) {};
    \node[stop2, rotate=-90, anchor=two half] (Piazza Virgilio) at ($(-3.6, 1.6) + (0,\offset)$) {};
    \node[stop2, rotate=-90, anchor=two half] (Via 20 Settembre) at ($(-4.7, 1.6) + (0,\offset)$) {};

    \node[stop1] (Castello Cairoli) at (-1.2,2.8) {};
    \node[stop1] (Ricasoli) at (-2.2,2.8) {};

    \node[stop3, rotate=-50] (Via Torino Via Palla) at (-.5,-1.4) {};
    \node[stop3, rotate=-50] (Via Torino Via S Maria Valle) at ($(Via Torino Via Palla) + (40:-.7)$) {};
    \node[stop3, rotate=-50] (Carrobbio) at ($(Via Torino Via S Maria Valle) + (40:-.7)$) {};
    \node[stop2, rotate=-50, anchor=one half] (Corso Genova Via Sapeto) at ($(Carrobbio.one half) + (40:-1.3)$) {};

    % ring
    \node[stop3, rotate=-30] (Centrale) at \polar{(61:\rad+4.2)} {};
    \node[stop2, anchor=west, rotate=65] (Monte Santo) at \polar{(62:\rad+.1)} {};
    \node[stop3, anchor=center, rotate=57] (Repubblica) at \polar{(55:\rad)} {};
    \node[stop3, anchor=center, rotate=45] (Vittorio Veneto) at \polar{(45:\rad)} {};
    \node[stop1, anchor=center] (Porta Venezia) at \polar{(32:\rad)} {};
    \node[stop2, anchor=one half, rotate=25] (Viale Piave) at \polar{(25:\rad)} {};
    \node[stop2, anchor=one half, rotate=19] (Tricolore) at \polar{(19:\rad)} {};
    \node[stop2, anchor=one half, rotate=13] (Viale Premuda) at \polar{(13:\rad)} {};
    \node[stop3, anchor=center, rotate=90] (Piazza 5 Giornate) at \polar{(-3:\rad)} {};
    \node[stop1, anchor=center] (Monte Nero Via Spartaco) at \polar{(-16:\rad)} {};
    \node[stop1, anchor=center] (Viale Monte Nero Via Bergamo) at \polar{(-27.5:\rad)} {};
    \node[stop1, anchor=center, rotate=-45] (Viale Monte Nero Via Pier Lombardo) at \polar{(-36:\rad)} {};
    \node[stop1, anchor=center, rotate=-45] (Porta Romana) at \polar{(-44:\rad)} {};
    \node[stop1, anchor=center, rotate=-45] (Viale Sabotino) at \polar{(-51:\rad)} {};
    \node[stop1, anchor=center, rotate=-50] (Via Ripamonti Viale Sabotino) at \polar{(-58:\rad)} {};
    \node[stop1, anchor=center] (Viale Bligny) at \polar{(-65:\rad)} {};
    \node[stop1, anchor=center] (Via Bocconi) at \polar{(-74:\rad)} {};
    \node[stop1, anchor=center, rotate=0] (Porta Lodovica) at \polar{(-85:\rad)} {};
    \node[stop1, anchor=center] (Viale Col di Lana) at \polar{(-96:\rad)} {};
    \node[stop2, anchor=two half, rotate=90] (24 Maggio) at \polar{(-106:\rad)} {};
    \node[stop2, anchor=two half, rotate=60] (Via Vigenavo Viale Gorizia) at \polar{(-115:\rad)} {};
    \node[stop4, anchor=north center, rotate=-45] (Piazzale Cantore) at \polar{(-130:\rad)} {};
    \node[stop2, rotate=-47, anchor=two half] (Porta Genova) at ($(Piazzale Cantore.two half) + (-140:1)$) {};
    \node[stop2, rotate=40, anchor=two half] (Piazzale Coni Zugna Via Solari) at \polar{(-140:\rad)} {};

    \node[stop1, anchor=center] (Viale Coni Zugna Via Foppa) at \polar{(-152:\rad)} {};
    \node[stop1, anchor=center] (Piazzale Aquileia) at \polar{(-159:\rad)} {};
    \node[stop1, anchor=center] (Viale San Michele del Carso Piazza De Meis) at \polar{(-165:\rad)} {};
    \node[stop1, anchor=center] (Piazzale Baracca) at \polar{(184:\rad)} {};
    \node[stop1, anchor=center] (Conciliazone) at \polar{(179:\rad)} {};
    \node[stop1, anchor=center] (Via Arosto) at \polar{(174:\rad)} {};
    \node[stop2, anchor=center, rotate=71] (Quinto Alpini) at \polar{(168:\rad)} {};
    \node[stop2, anchor=two half, rotate=-50] (Corso Sempione Via Canova) at \polar{(145:\rad-.8)} {};
    \node[stop2, anchor=center, rotate=-50] (Arco della Pace) at ($(Corso Sempione Via Canova) + (40:-.9)$) {};
    \node[stop2, anchor=center, rotate=-50] (Via Pagano Via Canova) at ($(Corso Sempione Via Canova) + (40:-1.5)$) {};

    \node[stop2, anchor=two half, rotate=50] (Corso Sempione Via Villasanta) at \polar{(140:\rad-.4)} {};

    \node[stop2, anchor=two half, rotate=50] (Corso Sempione Via Procaccini) at \polar{(140:\rad+.4)} {};

    \node[stop1, anchor=center, rotate=35] (Piazza Gramsci) at \polar{(135:\rad+.4)} {};
    \node[stop1, anchor=center, rotate=35] (Via Procaccini Via Lomazzo) at \polar{(130:\rad+.4)} {};
    \node[stop1, anchor=center, rotate=35] (Via Procaccini Via Nono) at \polar{(124:\rad+.4)} {};

    \node[stop2, anchor=center, rotate=30] (Piazzale Cimitero Monumentale Via Bramante) at \polar{(118:\rad+.4)} {};
    \node[stop1, anchor=center, rotate=35] (Monumentale) at \polar{(108:\rad+.4)} {};
    \node[stop3, anchor=center, rotate=9] (Via Farini Via Ferrari) at \polar{(95:\rad+.4)} {};


    \node[stop2, anchor=west, rotate=85] (Stazione Garibaldi) at \polar{(85:\rad+.1)} {};
    \node[stop2, anchor=west, rotate=80] (Viale Monte Grappa Via Gioia) at \polar{(76:\rad+.1)} {};
    \node[stop2, anchor=west, rotate=72] (Piazzale Principessa Clotilde Ospedale Fatebenefratelli) at \polar{(68:\rad+.1)} {};


    \node[stop2, anchor=one half] at ($(Via Farini Via Ferrari.one half) - (0, .7)$) (Piazzale Baiamonti) {};
    \node[stop2, anchor=one half] at ($(Piazzale Baiamonti.one half) - (0, .7)$) (Viale Montello) {};
    % TODO: there is one missing here (Via Bramante Via Giannone)!
    \node[stop2, anchor=one half, rotate=50] at ($(Lega Lombarda.north one half) + (140:1)$) (Via Bramante Via Sarpi) {};


    % west
    \node[stop1] (San Siro Stadio) at ($(Piazzale Baracca) + (-8,0) + (140:.9*7)$) {};

    \node[stop2, rotate=45, anchor=two half] (Domodossola) at ($(Corso Sempione Via Procaccini.one half) + (140:2.8)$) {};
    \node[stop1, anchor=north] at ($(Domodossola.south one half) + (45:-1.7) - (0,0.2)$) (Viale Boezio) {};
    \node[stop1, below=.5 of Viale Boezio] (6 Febbraio) {};

    % right side
    \node[stop3, rotate=90, anchor=east] (Missori) at ($(DuomoN) + (1.3,-0.1)$) {};
    \node[stop3, rotate=90] (Corso Porta Vittoria Camera del Lavoro) at ($(Piazza 5 Giornate) - (0.9,0)$) {};
    \node[stop3, rotate=90] (Palazzo di Guistizia) at ($(Piazza 5 Giornate) - (1.7,0)$) {};
    \node[stop3, rotate=90] (Augusto) at ($(Piazza 5 Giornate) - (2.6,0)$) {};
    \node[stop3, rotate=90, left=1 of Augusto.center, anchor=center] (Via Larga) {};

    \node[stop2] (Piazza Fontana) at ($(Augusto) + (-0.5,1)$) {};
    \node[stop2, rotate=35, anchor=two half] (Crocetta) at ($(Missori.south one half) + (-55:1.5)$) {};
    \node[stop2, rotate=35, anchor=two half] (Corso Porta Romana Via S Sofia) at ($(Crocetta.two half) - (-55:.7)$) {};



    % Città studi
    \node[stop3, rotate=90, anchor=one half] (Adalaide di Savoia) at ($(Viale Piave.north two half) + (2.2,0)$) {};
    \node[stop2, rotate=130, anchor=two half] (Via Valvassori Peroni) at ($(Adalaide di Savoia.one half) + (40:8*.8 + 0.8)$) {};
    \node[stop1, anchor=center] (Stazione Lambrate) at ($(Via Valvassori Peroni.south one half) + (0, 1.3) + (40:.3)$) {}; %\polar{(36:15.5)} {};
    \node[stop1, anchor=center] (Rimembranze di Lambrate) at ($(Via Valvassori Peroni.south two half) + (1.3,0) + (40:.3)$) {};

    \node[stop1, anchor=west] (Ortica) at ($(Adalaide di Savoia.south two half) + (6 + 1,-1)$) {};

    % 33 & 5
    \node[stop2, rotate=45, anchor=center] (Viale Tunisia) at \polar{(42:\rad+1.5)} {};
    \node[stop2, rotate=45, anchor=two half] (Porta Venezia Viale Tunisia) at ($(Viale Tunisia.two half) + (-45:1)$) {};
    \node[stop2, rotate=45, anchor=two half] (Piazza 8 Novembre) at ($(Viale Tunisia.two half) + (-45:2)$) {};
    % 5
    \node[stop2, rotate=-45, anchor=two half] (Via Vitruvio) at \polar{(42.8:\rad+4-.2)} {};
    \node[stop1] (Piazza Duca d'Aosta) at \polar{(50:\rad+4)} {};
    \node[stop2, rotate=-45, anchor=two half] (Piazza Cincinnato) at ($(Via Vitruvio.two half) + (45:-1)$) {};
    % 1
    \node[stop1] (Greco Rovereto) at ($(Via Vitruvio.two half) + (45:7*.8)$) {};


    % south
    \node[stop2, below=7*.6+1.7 of 24 Maggio.one half, rotate=-55, anchor=one half] (Piazza Abbiategrasso) {};



    % south of Città studi
    \node[stop2, rotate=90, right=4 of Piazza 5 Giornate.two half, anchor=two half] (Piazza Emilia) {};
    \node[stop1] (Viale Molise) at ($(Piazza Emilia) + (3,-1.8)$) {};
    \node[stop1, right=.9*6 of Piazza Emilia.two half] (Repetti) {};
    \node[stop1] (Viale Ungheria) at ($(Repetti.east) + (0.7,-8*.9)$) {};



    % north west
    \node[stop2, rotate=50] (Cenisio) at ($(Piazzale Cimitero Monumentale Via Bramante) + (140:1.5)$) {};
    \node[stop2, rotate=50, anchor=center] (Piazza Diocleziano) at ($(Cenisio.center) + (140:1.5)$) {};
    \node[stop2, rotate=90, anchor=two half] (Piazza Firenze) at ($(Piazza Diocleziano.north two half) + (-4,0)$) {};

    \node[stop2, rotate=90, anchor=one half] (Via Mac Mahon Via Artieri) at ($(Piazza Firenze.east) + (-1,2.6)$) {};
    \node[stop2, rotate=90, anchor=one half] (Piazza Castelli) at ($(Via Mac Mahon Via Artieri.one half) + (-2,0)$) {};

    \node[stop2, rotate=90] (Piazzale Accursio) at ($(Piazza Firenze) + (-4,0)$) {};
    \node[stop2, rotate=90, anchor=one half] (Piazzale Santorre di Santarosa) at ($(Piazza Castelli.one half) + (-4.8,0)$) {};
    \node[stop2, rotate=50, anchor=two half] (Viale Espinasse Via Palizzi) at ($(Piazzale Santorre di Santarosa.north two half) + (-.7,0) + (140:1)$) {};
    \node[stop2, rotate=50] (Roserio) at ($(Viale Espinasse Via Palizzi) + (140:6*.8)$) {};

    \node[stop1, left=4 + 4.2 of Piazzale Accursio.two half] (Piazzale Cimitero Maggiore) {};


    % north
    \node[stop2, above=2 of Via Farini Via Ferrari.one half, anchor=one half] (Via Farini Via Valtellina) {};
    \node[stop2, above=1.8 of Via Farini Via Valtellina] (Via Farini Viale Stelvio) {};

    \node[stop1] at ($(Via Farini Viale Stelvio.two half) + (0,1.8) + (140:4)$) (Ospedale Niguarda) {};
    \node[stop1] (Niguarda Parco Nord) at ($(Ospedale Niguarda) + 5*(90:.7)$) {};
    \node[stop1] (Bausan) at ($(Via Farini Viale Stelvio.north one half) + (-1.8,.5) + (140:.8*4+.3)$) {};

    \node[stop1] (Via Ugo Bassi) at ($(Via Farini Via Ferrari.two half) + (0,2) + (.4,0)$) {};

    \node[stop2, anchor=one half] (Piazzale Lagosta) at ($(Via Ugo Bassi) + (2,1.2)$) {};

    \node[stop2, rotate=-30, anchor=one half] (Centrale Via Tonale) at ($(Centrale.center) + (60:0.8)$) {};
    \node[stop2, rotate=-30, anchor=one half] (Viale Lunigiana) at ($(Centrale.center) + (60:1.7)$) {};

    \node[stop1] (Viale Lunigiana Via Gioia) at \polar{(65:\rad+6.1)} {};
    \node[stop1] (Piazza Carbonari) at \polar{(72:\rad+6.1)} {};

    \node[stop2, above=2.5 of Piazzale Lagosta.center, anchor=center] (Marche) {};
    \node[stop2, above=2.4 of Marche.center, anchor=center] (Ca Granda) {};
    \node[stop2, above=1.5 of Ca Granda] (Viale Testi Via S Marcellina) {};



    \node (Milano Porta Vittoria) at (8,-.5) {};
  \end{pgfonlayer}

  \begin{pgfonlayer}{lines}
    \pgfmathsetmacro{\offset}{0.1*tan(45/2)}
    \pgfmathsetmacro{\line}{0.2}


    \def\makeStation(#1, #2, #3)(#4)#5{
      node[stop1] (current) {}
      ($(current.#1) + (#4)$) node[label, anchor=#2, rotate=#3, align=center] {\labelContour{#5}}
      (current.center)
    }
    \def\makeStations(#1)(#2, #3, #4)#5{
      foreach[count=\count] \name in {#5} {
        -- ++(#1) node[stop1] (current) {}
        (current.#2) node[label, anchor=#3, rotate=#4, align=center] {\labelContour{\name}}
        (current.center)
      }
    }
    \def\makeShapes[#1][#2](#3)(#4, #5, #6)#7{
      foreach[count=\count] \name in {#7} {
        -- ++(#3) node[#1, anchor=#2] (current) {}
        (current.#4) node[label, anchor=#5, rotate=#6, align=center] {\labelContour{\name}}
        (current.#2)
      }
    }
    \def\makeAlternatingStations(#1)(#2, #3, #4)#5{
      foreach[count=\count] \one/\two in {#5} {
        -- ++(#1) node[stop1] (one) {}
        (one.#2) node[label, anchor=#3, rotate=#4, align=center] {\labelContour{\one}}
        (one.center)
        -- ++(#1) node[stop1] (two) {}
        (two.#3) node[label, anchor=#2, rotate=#4, align=center] {\labelContour{\two}}
        (two.center)
      }
    }

    %% \foreach\angle in {-170,-160,...,180} {
    %%   \draw[help line, color=gray!50] \polar{(0,0)} -- \polar{(\angle:8)};
    %%   \node at \polar{(\angle:8)} { \angle };
    %% };

    %% \draw[railway outwards]
    %% (Centrale.center)
    %% {[rounded corners=0.01cm]
    %% -- (Centrale.four eighth)
    %% }
    %% -- \polar{(61:12)}
    %% arc (90:20:4.4)
    %% -- \polar{(32:12.1)}
    %% arc(10:-12:30)
    %% {[rounded corners=2cm]
    %% -- \polar{(-40:10.5)}
    %% -- \polar{(-134:9.5)}
    %% }
    %% -- ++(-140:4.5)
    %% node[label, below, anchor=north west] {Mortara};

    %% \draw[railway line]
    %% (Porta Genova.five eighth)
    %% {[rounded corners=1cm]
    %% -- \polar{(-134:7)}
    %% }
    %% -- \polar{(-134:9.5)}
    %% -- ++(-140:4);

    %% \draw[railway line]
    %% \polar{(32:12.1)}
    %% arc(10:3:30)
    %% -- ($(Ortica) + (1,0.5)$)
    %% -- ++(0:2)
    %% ;

    %% \draw[railway] ($(Certosa.four sixth) - (-20:1) + (-4,0)$)
    %% node[label, above, anchor=south west] {Torino}
    %% -- ($(Certosa.four sixth) - (-20:1)$)
    %% -- (Certosa.four sixth)
    %% -- ($(Via Farini Via Valtellina) + (-2,0)$)
    %% -- ($(Via Farini Via Valtellina) - (0,.5)$)
    %% arc (90:70:12)
    %% -- ($(Viale Tunisia.four sixth)$)
    %% -- ($(Adalaide di Savoia.north west) - (0,.2)$)
    %% -- ($(Piazza Emilia.north) + (-.1,1)$)
    %% -- ($(Milano Porta Vittoria) - (1.4,0)$)
    %% -- ($(Milano Porta Vittoria)$)
    %% -- ($(Milano Porta Vittoria) + (2,0)$)
    %% -- ($(Repetti) + (-.15,0)$)
    %% -- ($(Repetti) + (-.4,1)$)
    %% -- ($(Ortica) + (1,0.5)$)
    %% -- ++(0:3)
    %% node[label, below right, anchor=north] {Verona}
    %% ;

    %% \draw[railway outwards]
    %% ($(Via Farini Via Valtellina) - (0,.5)$)
    %% arc (90:85:12)
    %% -- \polar{(75:6)}
    %% {[rounded corners=2cm]
    %% -- ++(65:8)
    %% }
    %% -- ++(85:5)
    %% node[label, below left, anchor=north east] {Chiasso (CH)}
    %% ;

    %% \draw[railway line]
    %% (Centrale.center)
    %% {[rounded corners=0.01cm]
    %% -- (Centrale.four eighth)
    %% }
    %% -- \polar{(61:12)}
    %% -- ($(75:6) + (65:8) + (-.2,.5)$)
    %% -- ++(85:5)
    %% ;

    %% \draw[railway outwards]
    %% ($(Repetti) + (-.15,0)$)
    %% arc(-3:-12:30)
    %% -- ++(1,-2)
    %% -- ++(-30:2)
    %% node[label, above, anchor=south west] {Bologna}
    %% ;

    %% \draw[railway outwards]
    %% ($(Repetti) + (-.15,0)$)
    %% arc(-3:-12:30)
    %% -- ++(1,-2)
    %% -- ++(-90:2)
    %% node[label, above, anchor=south west] {Genova}
    %% ;

    %% \draw[railway line]
    %% (Certosa.four sixth)
    %% -- ($(Certosa.four sixth) + (-20:1)$)
    %% -- ++(1,1.4)
    %% arc (110:78:25)
    %% -- \polar{(61:12)}
    %% arc (90:20:4.4)
    %% -- \polar{(32:12.1)}
    %% ;

    %% \draw[railway line]
    %% (Certosa.four sixth)
    %% -- ($(Certosa.four sixth) + (-20:1)$)
    %% -- ++(1,1.4)
    %% arc (110:78:25)
    %% -- \polar{(61:12)}
    %% -- (Centrale.four eighth)
    %% ;

    %% \draw[railway line]
    %% ($(Certosa.four sixth) + (-17:3)$)
    %% -- ($(Certosa.four sixth) + (-20:1) + (.5,0)$)
    %% -- ($(Certosa.four sixth) + (-20:1) + (1,1.4)$)
    %% arc (110:78:25)
    %% -- \polar{(61:12)}
    %% -- (Centrale.four eighth)
    %% ;

    %% \draw[railway outwards]
    %% ($(Piazza Virgilio.one half) + (1,0)$) % TODO should be Cadorna
    %% {[rounded corners=.3cm]
    %% -- ++ (-0.7,.1)
    %% }
    %% -- \polar{(135:5)}
    %% -- ($(Piazza Diocleziano) - (1,.3)$)
    %% arc (-135:-180:10)
    %% -- ++(0,2)
    %% node[label, below left, anchor=west] {Asso}
    %% ;

    %% \draw[railway outwards]
    %% ($(Piazza Virgilio.one half) + (1,0)$) % TODO should be Cadorna
    %% {[rounded corners=.3cm]
    %% -- ++ (-0.7,.1)
    %% }
    %% -- \polar{(135:5)}
    %% -- ($(Piazza Diocleziano) - (1,.3)$)
    %% arc (-135:-180:10)
    %% -- ++(135:2)
    %% node[label, below left, anchor=west] {Saronno}
    %% ;


    \draw[line, one]
    (Greco Rovereto)
    \makeStations(45:-.8)(east, west, 0){
      Piazza Morbegno,
      Via Venini Via Sauli,
      Via Venini Via Battaglia,
      Viale Brianza,
      Caiazzo,
      Via Settembrini
    }
    ++(0,0)
    -- (Via Vitruvio.two half)
    -- (Piazza Cincinnato.two half)
    -- (Viale Tunisia.east)
    -- (Viale Tunisia.west)
    {[rounded corners=0.3cm]
    -- ($(Vittorio Veneto.south one half) + \line*(.7,-.7)$)
    }
    -- (Vittorio Veneto.one half)
    -- \centerarc(46:58:5.8)
    %% -- (Repubblica.one half)
    %% -- (Repubblica.north one half)
    {[rounded corners=0.5cm]
    -- ++(-1.2,.1)
    }
    \makeStations(0,-.8)(east, west, 0){Turati, Piazza |Cavour, Montenapoleone, Teatro |alla Scala}
    {[rounded corners = 0.7cm]
    -- ($(Cordusio.two half) + (1.6,0)$)
    }
    -- (Cordusio.two half)
    -- (Cusani.two half)
    -- ++(0,0.25)
    -- ($(Cusani.one half) + (-.2,.25)$)
    -- ++(-.2,-.1)
    -- ++(-.3,0) \makeStation(north, south, 0)(0,-.1){Cairoli}
    -- ++(-.8,0) \makeStation(south, north, 0)(0,.1){Foro Buonaparte |Via Ricasoli}
    -- ++(-.8,0) \makeStation(north, south, 0)(0,-.1){Cadorna}
    -- (Piazza Virgilio.north one half)
    -- (Piazza Virgilio.one half)
    -- (Quinto Alpini.two half)
    -- ($(Quinto Alpini.north two half)$)
    -- ++($(.05,.2+.5*\offset)$)
    -- (Via Pagano Via Canova.one half)
    -- (Arco della Pace.one half)
    -- (Corso Sempione Via Canova.one half)
    -- (Corso Sempione Via Canova.north one half)
    -- (Corso Sempione Via Procaccini.one half)
    -- (Domodossola.two half)
    -- ($(Piazza Firenze.south one half)$)
    -- (Piazzale Accursio.one half)
    -- (Piazzale Accursio.north one half)
    -- ++(140:.2)
    \makeStations(140:1.1)(west, east, 0){
      Viale Espinasse |Piazzale Accursio,
      Viale Espinasse |Via Casella,
      Viale Espinasse |Via Nuvolone
    }
    -- (Piazzale Santorre di Santarosa.south one half)
    -- (Piazzale Santorre di Santarosa.north one half)
    -- ++(-.7-\offset,0)
    -- (Viale Espinasse Via Palizzi.south one half)
    -- (Viale Espinasse Via Palizzi.one half)
    -- (Roserio.one half)
    ;

    \draw[line, two]
    (Bausan)
    \makeStations(140:-.8)(south west, east, 0){
      Via Imbriani Via Scalvini,
      Piazzale Nigra,
      Lancetti,
      Via Berinina
    }
    -- ++(140:-.2)
    {[rounded corners=.3cm]
    -- ($(Via Farini Viale Stelvio.north one half) + (-1.5,.5)$)
    -- ($(Via Farini Viale Stelvio.north one half) + (0,.5)$)
    }
    -- (Via Farini Viale Stelvio.north one half)
    -- (Via Farini Viale Stelvio.one half)
    -- (Via Farini Via Valtellina.one half)
    -- (Via Farini Via Ferrari.one half)
    -- ($(Lega Lombarda.north three quarter) + 2*\offset*(-.7,.7)$)
    -- (Lega Lombarda.three quarter)
    -- (Arena.three quarter)
    -- (Arena.south three quarter)
    -- ($(Lanza.north three quarter) + (0,2*\offset)$)
    -- (Lanza.three quarter)
    -- (Cusani.three quarter)
    -- (Cordusio.three quarter)
    -- (DuomoN.two half)
    {[rounded corners=.1cm]
    -- ($(Duomo.south two quarter) - tan(40/2)*(0,.2)$)
    }
    -- (Via Torino Via Palla.center)
    -- (Via Torino Via S Maria Valle.center)
    -- (Carrobbio.center)
    -- (Corso Genova Via Sapeto.south two half)
    -- (Piazzale Cantore.north three quarter)
    -- (Piazzale Cantore.three quarter)
    -- (Porta Genova.one half)
    -- (Porta Genova.south one half)
    -- ++(-1,0)
    -- ++(35:-.4)
    \makeStations(35:-1.2)(north east, north west, 0){
      Via Valenza Alzaia |Naviglio Grande,
      Ripa di Porta Ticinese |Via Lombardini
    }
    -- ++(35:-.6)
    \makeStations(35:-.8)(south east, west, 0){
      Ripa di Porta Ticinese Via D'Adda,
      Ponte Guido Crepax,
      Via Lodovico il Moro Via Pestalozzi,
      Via Lodovico il Moro 25,
      Via Lodovico il Moro Cavalcavia Don Milani,
      Via Lodovico il Moro Via Guintellino
    }
    (current.center)
    -- ++(35:-.8) node[stop1] (Piazzale Negrelli) {}
    ;

    \draw[line, three]
    (Duomo.three quarter)
    {[rounded corners=.2cm]
    -- ($(Duomo.south three quarter) - tan(40/2)*(0,.4)$)
    }
    -- (Via Torino Via Palla.two half)
    -- (Via Torino Via S Maria Valle.two half)
    -- (Carrobbio.two half)
    -- (Carrobbio.south two half)
    -- ++(50:-.1)
    \makeStations(0,-.7)(east, west, 0){Colonne di |San Lorenzo, Piazza |S Eustorgio}
    -- (24 Maggio)
    -- ++(0,-1.5)
    \makeStation(west, east, 0)(.1,0){Corso Gottardo |Via Lagrange}
    \makeAlternatingStations(0,-.6)(east, west, 0){
      Largo |Mahler/Viale Tibaldi |Via Meda,
      Via Meda |Via Spaventa/Via Montegani |Viale Da Cermenate,
      Via Montegani |Via Palmieri/Via Montegani |Via Neera
    }
    -- (Piazza Abbiategrasso.one half)
    -- (Piazza Abbiategrasso.south one half)
    -- ++(35:-.7*8+.2)
    ;

    \draw[line, four]
    (Niguarda Parco Nord)
    \makeStations(-90:.7)(west, east, 0){
      Cascina California,
      Niguarda Nord,
      Niguarda Centro,
      Girola
    }
    -- (Ospedale Niguarda.one half)
    {[rounded corners=0.3cm]
    -- ++(0,-.4)
    }
    \makeStations(140:-1)(west, east, 0){
      Nizza, Valassina, Maciachini
    }
    {[rounded corners=0.3cm]
    -- ++(140:-1)
    -- ($(Via Farini Viale Stelvio.two half) + (0,.6)$)
    }
    -- (Via Farini Viale Stelvio.two half)
    -- (Via Farini Via Valtellina.two half)
    \makeShapes[stop2][two half](0,1)(west, east, 0){Via Farini |Via Alserio}
    -- (Via Farini Via Ferrari.center)
    -- ($(Lega Lombarda.north two half)$)
    -- (Lega Lombarda.two half)
    -- (Arena.two half)
    -- (Arena.south two half)
    -- ($(Lanza.north two half) + (0,3*\offset)$)
    -- (Lanza.two half)
    -- ++(0,-\line)
    -- ($(Lanza.one half) + (-\line,-\line)$)
    -- (Castello Cairoli)
    -- (Ricasoli)
    ;

    \draw[line, five]
    (Ortica)
    \makeAlternatingStations(-1,0)(north, south, 0){
      Via Amadeo |Via S Benigno/Via Amadeo |Via Paladini,
      Via Beato Angelico |Via Aselli/Via Beato Angelico |Via Colombo,
      Piazza |Ferravilla/Piazza |Aspari
    }
    -- ++(-.2,0)
    {[rounded corners=.15cm]
    -- ++(-.2,0)
    -- ($(Adalaide di Savoia.south two half) + (\offset, 0)$)
    }
    -- (Adalaide di Savoia.two half)
    -- (Adalaide di Savoia.north two half)
    -- (Piazza 8 Novembre.two half)
    -- (Porta Venezia Viale Tunisia.two half)
    -- (Viale Tunisia.two half)
    -- (Viale Tunisia.north two half)
    -- (Piazza Cincinnato.one half)
    -- (Via Vitruvio.one half)
    -- (Via Vitruvio.north one half)
    -- \centerarc(45:60:10)
    %% -- ($(Centrale.south two half) + (0,2*\offset)$)
    -- (Centrale.two half)
    -- (Viale Lunigiana.south two half)
    -- (Viale Lunigiana.two half)
    -- (Viale Lunigiana.north two half)
    -- \centerarc(61:78:12.1)
    %% {[rounded corners=0.2cm]
    %%   -- ($(Marche.south one half) - (0,\line)$)
    %% }
    -- (Marche.south one half)
    -- (Marche.one half)
    -- (Ca Granda.one half)
    -- (Ca Granda.north one half)
    \makeAlternatingStations(-1.4,0)(north, south, 0){
      Viale Ca Granda |Viale Suzzani/Viale Ca Granda |Via Val Furva
    }
    -- ++(-1.4,0) \makeStation(north, south, 0)(0,0){Viale Ca Granda |Via Cherasco}
    -- (Ospedale Niguarda)
    ;

    \draw[line, seven]
    (Piazzale Lagosta.two half)
    -- ++(0,1.3) \makeStation(east, west, 0)(0,0){Zara}
    -- (Marche.two half)
    \makeShapes[stop2][two half](0,.63)(east, west, 0){
      Viale Zara |Via Laurana,
      Istria,
      Viale Testi |Via Dolcebuono
    }
    -- (Ca Granda.two half)
    -- ++(0,.8) \makeStation(east, west, 0)(0,0){Viale Testi |Via Pianelli}
    -- (Viale Testi Via S Marcellina.two half)
    {[rounded corners=.3cm]
    -- ++(0,1)
    }
    -- ++(.3,.3) \makeStation(north, south west, 0)(0:-.5){Via Pulci |Viale Serca}
    \makeAlternatingStations(0:1)(south, north, 0){
      Università |Bicocca Scienza/Stazione |Greco Pirelli,
      Arcimboldi |Ateneo Nuovo/Largo Mattei,
      Precotto/Parmenide
    }
    -- ++(0:1) \makeStation(south, north, 0)(0,0){Anassagora}
    -- ++(0:1) node[stop1] (Precotto Interno Deposito) {}
    ;

    \draw[line, nine]
    (Centrale.one half)
    -- (Centrale.south one half)
    -- ($(Monte Santo.east) + (0,2*\offset)$)
    %% -- (Monte Santo.east)
    -- (Monte Santo.west)
    %% -- (Repubblica.north center)
    -- \centerarc(61:-123:\rad)
    %% -- (Vittorio Veneto.center)
    %% -- (Porta Venezia)
    %% -- (Viale Piave.one half)
    %% -- (Piazza 5 Giornate.one half)
    %% -- (Monte Nero Via Spartaco)
    %% -- (Viale Monte Nero Via Bergamo)
    %% -- (Porta Romana)
    %% -- (Via Ripamonti Viale Sabotino)
    %% -- (Porta Lodovica)
    %% -- (24 Maggio.two half)
    %% -- (Via Vigenavo.two half)
    -- (Piazzale Cantore.north two half)
    -- (Piazzale Cantore.two half)
    -- (Porta Genova.two half)
    ;

    \draw[line, ten]
    (24 Maggio.one half)
    -- \centerarc(-109:-113:6.2)
    -- (Via Vigenavo Viale Gorizia.one half)
    -- (Via Vigenavo Viale Gorizia.north one half)
    {[rounded corners=0.2cm]
    -- ++(-.5,-.25) \makeStation(south, north, 0)(0,0.1){Via Vigenavo |Via Corsico}
    -- ($(Porta Genova.east) + (.4,-.1)$)
    }
    -- (Porta Genova.east)
    -- ($(Porta Genova.west) + .1*(-.7,.7)$)
    -- (Piazzale Cantore.two quarter)
    %% -- ($(Piazzale Cantore.north one half) - \offset*(1,1)$)
    -- \centerarc(-131:-190:\rad)
    %% -- (Piazzale Cantore.north one half)
    %% -- (Piazzale Cantore.one half)
    %% -- (Piazzale Coni Zugna Via Solari.south two half)
    %% -- (Piazzale Coni Zugna Via Solari.two half)
    %% -- (Piazzale Aquileia)
    %% -- (Piazzale Baracca)
    -- (Quinto Alpini.center)
    -- ($(Quinto Alpini.east) + (0,2*\offset)$)
    %% {[rounded corners=.5cm]
    %% -- \polar{(152:4.8)}
    %% }
    -- (Via Pagano Via Canova.two half)
    -- (Arco della Pace.two half)
    -- (Corso Sempione Via Canova.two half)
    {[rounded corners=0.3cm]
    -- ($(Corso Sempione Via Canova.north two half) + (45:\line)$)
    }
    -- (Corso Sempione Via Procaccini.two half)
    %% {[rounded corners=0.3cm]
    %% -- \polar{(130:5.4)}
    %% }
    %% -- (Via Bramante.west)
    %% -- (Via Bramante.east)
    %% {[rounded corners=0.3cm]
    %% -- \polar{(110:5.2)}
    %% }
    %% -- (Via Farini Via Ferrari.west)
    %% -- (Via Farini Via Ferrari.east)
    -- \centerarc(139:72:6.4)
    -- (Monte Santo.two half)
    -- ($(Monte Santo.south two half) + (0,2*\offset)$)
    -- ++(61:.2)
    \makeShapes[stop2, rotate=-30][two half](61:.8)(two half, west, 0){
      Piazza |San Giachimo, Via Filzi |Via Pirelli, Via Filzi |Via Galvani
    }
    -- ($(Centrale.south center) $)
    -- (Centrale.center)
    -- (Viale Lunigiana.one half)
    ;

    \draw[line, twelve]
    (Viale Molise)
    \makeStations(-1,0)(north, south, 0){
      Piazzale |Martini,Via |Arconati
    }
    {[rounded corners=.3cm]
    -- ++(-.6,0)
    -- ($(Piazza Emilia.south one half) + (.1,0)$)
    }
    -- (Piazza Emilia.one half)
    -- (Piazza 5 Giornate.center)
    -- (Augusto.center)
    -- (Via Larga.center)
    -- ($(Via Larga.north center) - tan(30/2)*(.2,0)$)
    -- ($(Missori.south two half)$)
    -- (Missori.two half)
    -- ($(DuomoN.four sixth) - (0,.2)$)
    -- (DuomoN.four sixth)
    -- (Cordusio.three sixth)
    -- (Cusani.one half)
    -- (Lanza.one half)
    -- ($(Lanza.north one half)$)
    -- (Arena.south one half)
    -- (Arena.one half)
    -- (Lega Lombarda.one half)
    -- (Lega Lombarda.north one half)
    -- (Via Bramante Via Sarpi.one half)
    %% -- ($(Via Bramante.south one half) - (0,\offset)$)
    -- (Piazzale Cimitero Monumentale Via Bramante.one half)
    %% -- (Via Bramante.north one half)
    -- (Cenisio.south one half)
    -- (Cenisio.one half)
    -- (Piazza Diocleziano.one half)
    -- (Piazza Diocleziano.north one half)
    -- ++(140:.8)
    \makeStations(140:1.3)(north east, west, 0){
      Via Mac Mahon |Via Principe Eugenio,
      Via Mac Mahon |Via Caracciolo,
      Via Mac Mahon |Viale Monte Ceneri
    }
    -- (Via Mac Mahon Via Artieri.two half)
    -- (Piazza Castelli.two half)
    -- (Piazza Castelli.north two half)
    \makeAlternatingStations(180:1)(north, south, 0){
      Via Console |Marcello |Via Grugnola/Via Console |Marcello |Villapizzone
    }
    -- ++(180:1) \makeStation(north, south, 0)(0,0){Via Console |Marcello |Via Monte Altissimo}
    -- (Piazzale Santorre di Santarosa.two half)
    -- (Piazzale Santorre di Santarosa.north two half)
    -- ++(-0.7,0)
    -- (Viale Espinasse Via Palizzi.two half)
    \makeShapes[stop2, rotate=50][two half](140:.8)(east, west, 0){
      Certosa, Via Palazzi Via Mambretti, Via Mambretti, Largo Boccioni, Via Grassi
    }
    -- (Roserio.two half)
    ;

    \draw[line, fourteen]
    % TODO
    (Piazzale Cimitero Maggiore)
    \makeAlternatingStations(1,0)(south, north, 0){
      Viale Certosa |Cimitero Maggiore/Viale Certosa |Via Cormons,
      Viale Certosa |Via Gradisca/Viale Certosa |Via Tibullo
    }
    \makeStations(1.2,0)(south, north, 0){
      Viale Certosa |Via Giannini
    }
    \makeStations(1.7,0)(south, north, 0){
      Viale Certosa |Via Casella
    }
    -- (Piazzale Accursio.two half)
    \makeShapes[stop2, rotate=90][two half](1.3,0)(west, north, 0){
      Viale Certosa |Via Grosotto
    }
    \makeShapes[stop2, rotate=90][two half](1,0)(east, south, 0){
      Viale Certosa |Viale Serra
    }
    -- (Piazza Firenze.two half)
    -- ++(2,0) \makeStation(south, north, 0)(0,0){Piazza Caneva}
    -- (Piazza Diocleziano.north two half)
    -- (Piazza Diocleziano.two half)
    \makeShapes[stop2, rotate=50][two half](140:-.7)(center, south west, 0){
      Via Cenisio |Via Induno
    }
    -- (Cenisio.two half)
    %% -- ($(Via Bramante.north two half)$)
    -- (Piazzale Cimitero Monumentale Via Bramante.two half)
    %% -- (Via Bramante.south two half)
    -- (Via Bramante Via Sarpi.two half)
    -- (Lega Lombarda.north two quarter)
    -- (Lega Lombarda.two quarter)
    -- (Arena.two quarter)
    -- (Arena.south two quarter)
    -- ($(Lanza.north two quarter) + (0,\offset)$)
    -- (Lanza.two quarter)
    -- (Cusani.two quarter)
    -- (Cordusio.four sixth)
    -- (DuomoN.one half)
    -- ($(Duomo.south one half)$)
    -- (Via Torino Via Palla.one half)
    -- (Via Torino Via S Maria Valle.one half)
    -- (Carrobbio.one half)
    -- (Corso Genova Via Sapeto.one half)
    -- ($(Piazzale Cantore.north two quarter) + \offset*(2,2)$)
    -- (Piazzale Cantore.one half)
    -- \centerarc(-132:-140:6.2)
    %% -- ($(Piazzale Cantore.south two quarter) + (0,-\offset)$)
    %% -- ($(Piazzale Cantore.south one half) + (-\offset,-\offset)$)
    -- (Piazzale Coni Zugna Via Solari.one half)
    {[rounded corners=0.2cm]
    -- ($(Piazzale Coni Zugna Via Solari.north one half) + (-.1,.1)$)
    }
    -- ++(30:-0.8)
    \makeStations(35:-.8)(north west, east, 0){
      Via Montevideo,
      Piazza del Rosario,
      Via Solari Via Stendhal,
      Piazza Napoli,
      Via Giambellino Via Tolstoj,
      Via Giambellino Via Vignoli,
      Via Brunelleschi,
      Largo Gelsomini Largo Giambellino,
      Via Giambellino Via Odazio,
      San Cristoforo,
      Via Gonin Via Guirdani,
      Via Gonin Via M di Lorenteggio
    }
    -- ++(35:-0.8) node[stop1] (Lorenteggio) {}
    ;

    \draw[line, fifteen]
    (Duomo.two half)
    -- (Duomo.south two half)
    -- ++ (0,-.5)
    \makeStations(0,-0.9)(east, west, 0){Corso |Italia |Missori, Corso Italia |Via S Sofia, Corso Italia |Via Lusardi}
    -- (Porta Lodovica)
    -- ++(0,-.6)
    \makeStations(0,-.6)(east, west, 0){
      Castelbarco,
      Giambologna,
      Tibaldi,
      Pezzotti,
      Giovanni |da Cermanate,
      Volvinio
    }
    (current.south)
    -- ++(0,-.3)
    \makeStations(35:-.9)(east, west, 0){Agrippa, Medeghino}
    -- (Piazza Abbiategrasso.north two half)
    -- (Piazza Abbiategrasso.two half)
    \makeShapes[stop2, rotate=-55][two half](35:-.7)(east, west, 0){
      Via dei Missaglie Via Boifava,
      Via dei Missaglie Via S Abbondio,
      Via dei Missaglie Isola Anita,
      Via dei Missaglie De Ruggiero,
      Via dei Missaglie Via Feraboli,
      Via dei Missaglie Via Saponaro,
      Via dei Missaglie Scuola Santarosa
    }
    -- ++(35:-.7) node[stop2, rotate=-55, anchor=two half] (Via dei Missaglie Via Baroni) {}
    -- (Via dei Missaglie Via Baroni.south two half)
    \makeAlternatingStations(-.8,0)(south, north, 0){
      Via Curiel |Via Maggi/Via Curiel |Via Lambro,
      Via Curiel |Viale Isonzo/Via Grandi |Via Bouzzi,
      Viale |Romagna/Via |Cabrini,
      Viale |Don Lonni/Viale Liguria |Via delle Mimose
    }
    -- ++(-1,0) \makeStation(south, north, 0)(0,0){Viale Liguria |Via Guido Rossa}
    -- ++(-1,0) node[stop1] (Via Guido Rossa) {}
    ;

    \draw[line, sixteen]
    (San Siro Stadio)
    \makeStations(140:-.9)(west, east, 0){
      Piazza Axum |Stadio Meazza,San Siro |Ippodromo,
      Piazza |Esquilino,Segesta,
      Piazza |Monte Falterona,
      Via Dolci |Via Ricciarelli
    }
    ++(0,0)
    {[rounded corners=.5cm]
    -- ++(140:-.9)
    }
    \makeAlternatingStations(1,0)(south, north, 0){
      Piazzale Brescia |Ospedale San Luca/Via Faruffini |Via Corregio,
      De Angeli/Piazza |Piemonte,
      Corso Vercelli |Via Cherubini/Corso Vercelli |Largo Settimio Severo
    }
    -- (Piazzale Baracca)
    -- ++(1.4,0) \makeStation(south, north, 0)(0,.1){S Maria delle Grazie |Cenacolo Vinciano}
    {[rounded corners=.2cm]
    -- ++(.5,0)
    -- ($(Largo d'Ancona.north one half) - (.1,0)$)
    }
    -- (Largo d'Ancona.north one half)
    -- (Via Meravigli.one half)
    -- (Cordusio.one half)
    -- (DuomoN.six tenth)
    {[rounded corners=0.5cm]
    -- ($(DuomoN.six tenth) - (0,0.6)$)
    }
    -- (Missori.one half)
    -- ($(Missori.south one half) - tan(35/2)*(.1,0)$)
    -- (Corso Porta Romana Via S Sofia.north two half)
    -- (Corso Porta Romana Via S Sofia.south two half)
    -- (Crocetta.two half)
    -- (Crocetta.south two half)
    -- ++(-50:.3)
    -- ++(1,0) \makeStation(south, north, 0)(90:0.1){Via Lamarmora |Via Commenda}
    -- ++(.9,0) \makeStation(north, south, 0)(-90:.1){Via |Lamamora}
    -- (Viale Monte Nero Via Bergamo.west)
    -- (Viale Monte Nero Via Bergamo)
    -- ++(1.7,0)
    \makeStations(-50:.7)(east, west, 0){
      Via Bergamo,Via Cadore |Via Bergamo,
      Via Comelico,Viale Umbria |Via Comelico
    }
    -- ++(-50:.8)
    -- ++(0.4,0)
    \makeAlternatingStations(0.8,0)(south, north, 0){
      Via Tito |Livio/Piazza |Salgari,
      Piazzale |Cuoco/Via Del Turchino |Via Maspero
    }
    -- ++(1,0) node[stop1] (Via Monte Velino) {}
    ;

    \draw[line, nineteen]
    (Stazione Lambrate)
    %% arc (10:8.5:30)
    -- ($(Via Valvassori Peroni.south one half) + (40:.3)$)
    -- (Via Valvassori Peroni.one half)
    {[rounded corners=0.2cm]
    -- ($(Adalaide di Savoia.south one half) + tan(40/2)*(.2,0)$)
    }
    -- (Adalaide di Savoia.one half)
    -- ++(-1.3,0) \makeStation(south, north, 0)(0,+.1){Via |Bixio}
    -- (Viale Piave.north two half)
    -- (Viale Piave.two half)
    -- \centerarc(19:0:6.2)
    -- ($(Piazza 5 Giornate.one half) + (\line,0)$)
    -- (Piazza 5 Giornate.one half)
    -- (Augusto.one half)
    -- (Via Larga.one half)
    -- (Via Larga.north one half)
    -- ($(Missori.south center) + tan(30/2) *(.2,0)$)
    -- (Missori.center)
    {[rounded corners=0.3cm]
    -- ($(DuomoN.five eighth) - (0,0.4)$)
    }
    -- (DuomoN.five eighth)
    -- (Cordusio.two quarter)
    -- ($(Cordusio.north two quarter)$)
    -- (Via Meravigli.two half)
    {[rounded corners=0.3cm]
    -- (Largo d'Ancona.north two half)
    -- ($(Piazza Virgilio.north two half) + (0.1,0)$)
    }
    -- (Quinto Alpini.one half)
    -- (Quinto Alpini.north one half)
    \makeStations(143:1)(south, east, 0){Via Monti Via Savoia Cavalleria, Via Monti Via Comerio}
    {[rounded corners=.2cm]
    -- ($(6 Febbraio.south) - (0,.2)$)
    -- (6 Febbraio)
    -- (Viale Boezio)
    -- ($(Viale Boezio) + (0,.2)$)
    }
    -- (Domodossola.south one half)
    -- (Domodossola.one half)
    \makeShapes[stop2, rotate=50][one half](139:.7)(west, east, 0){
      Corso Sempione Via Arona,Corso Sempione Via E Filiberto
    }
    -- (Piazza Firenze.west)
    -- ($(Piazza Firenze.east)$)
    {[rounded corners=0.4cm]
    -- ++(-.5,0.2)
    }
    -- ++(90:.5) \makeStation(east, west, 0)(0,0){Via Bartolini |Viale Monte Ceneri}
    \makeStations(90:.7)(east, west, 0){
      Via da Panicale,
      Piazza |Prealpi
    }
    {[rounded corners=0.4cm]
    -- ($(Via Mac Mahon Via Artieri.one half) + (.5,0)$)
    }
    -- (Via Mac Mahon Via Artieri.one half)
    \makeShapes[stop2, rotate=90][one half](-.8,0)(west, north, 0){
      Via Mac Mahon |Via Bramantino
    }
    -- (Piazza Castelli.one half)
    ;

    \draw[line, twentyfour]
    (Piazza Fontana.one half)
    {[rounded corners=0.2cm]
      |- ++(0,-.7)
    }
    -- ($(Via Larga.two half) + (.1,0)$)
    -- (Via Larga.two half)
    -- ($(Via Larga.north two half) - tan(30/2)*(.4,0)$)
    -- ($(Missori.south two half) + (0,.2) - tan(30/2)*(.2,0)$)
    -- (Missori.east)
    -- ($(Missori.west)$)
    -- (Corso Porta Romana Via S Sofia.north one half)
    -- (Corso Porta Romana Via S Sofia.one half)
    -- (Crocetta.one half)
    -- (Crocetta.south one half)
    {[rounded corners=0.3cm]
      -- ++(-50:.4)
    }
    -- ++(-75:1) \makeStation(east, west, 0)(-.15,0){Corso Porta |Vigentina}
    -- (Via Ripamonti Viale Sabotino)
    -- ++(-70:.5)
    \makeStations(-70:0.6)(east, west, 0){
      Via Ripamonti Via Bellezza,
      Viale Isonzo Via Ripamonti,
      Via Ripamonti Via Lorenzini,
      Via Ripamonti Via Rutilia,
      Via Ripamonti Via Quaranta,
      Via Ripamonti Via dell'Assunta,
      Via Ripamonti Via Noto,
      Via Ripamonti Via Val di Sole,
      Via Ripamonti Via Chopin
    }
    -- ++(-70:0.6) node[stop1] (Vigentino) {}
    ;

    \draw[line, twentyseven]
    (Viale Ungheria)
    \makeStations(0,.9)(east, west, 0){
      Viale Ungheria |Largo Guerrieri |Gonzaga,
      Viale Ungheria |Via Mecente,
      Via Mecenate |Via Quintiliano,
      Via Mecenate |Via Fantoli,
      Via Mecanate |Via Zante,
      Via Mecanate |Via Maderna,
      Piazza |Ovidio
    }
    ++(0,0)
    {[rounded corners=.3cm]
    -- ($(Repetti.east) + (.7,0)$)
    }
    -- (Repetti)
    \makeAlternatingStations(-.9,0)(south, north, 0){
      Stazione |Forlanini/Viale Corsica |Via Negroli,
      Viale Corsica |Via Lomellina/Viale Campania |Viale Corsica
    }
    -- ++(-.8,0) \makeStation(south, north, 0)(0,0){Piazza |Grandi}
    -- (Piazza Emilia.two half)
    \makeShapes[stop2, rotate=90][two half](-1.2,0)(west, north, 0){
      Via Cadore |Corso 22 Marzo
    }
    \makeShapes[stop2, rotate=90][two half](-1.2,0)(east, south, 0){
      Piazza Santa Maria |del Suffragio
    }
    -- (Piazza 5 Giornate.two half)
    -- (Augusto.two half)
    -- ++(-.1,0)
    {[rounded corners=0.2cm]
      -- ($(Piazza Fontana.two half) - (0,.7)$)
    }
    -- (Piazza Fontana.two half)
    ;

    \draw[line, thirtyone]
    (Viale Testi Via S Marcellina.one half)
    -- ++(0,1.3) \makeStation(west, east, 0)(0,0){Bicocca}
    \makeStations(90:0.8)(west, east, 0){
      Viale Testi |Via La Farina,
      Viale Testi |Via S Glicerio
    }
    {[rounded corners=0.5cm]
    -- ++(0,1)
    }
    \makeAlternatingStations(0:-1)(south, north, 0){
      Ponale/Bigami,
      Parco Nord |Torretta/Parco Nord |Clerici Sesto S G,
      Parco Nord |Instituto Tecnico/Parco Nord |Ospedale Bassini,
      Gorky |Monfalcone/Garmsci,
      Villa |Ghirlanda/Monte |Ortigara
    }
    -- ++(-1,0) node[stop1] (Primo Maggio) {}
    ;

    \draw[line, thirtythree]
    (Rimembranze di Lambrate)
    -- ($(Via Valvassori Peroni.south two half) + (40:.3)$)
    -- (Via Valvassori Peroni.two half)
    \makeShapes[stop2, rotate=-50][one half](40:-.8)(south east, west, 0){
      Via Bassini Via Golgi,
      Via Bassini Via Ponzio,
      Piazza Leonardo da Vinci (Politecnico),
      Via Pascoli Piazza Leonardo da Vinci,
      Viale Romagna Via Pascoli,
      Piazza Carlo Erba,
      Piazza Ascoli
    }
    -- (Adalaide di Savoia.south center)
    -- (Adalaide di Savoia.center)
    -- ($(Adalaide di Savoia.north center) + (-2*\offset,0)$)
    -- (Piazza 8 Novembre.one half)
    -- (Porta Venezia Viale Tunisia.one half)
    -- (Viale Tunisia.one half)
    -- (Viale Tunisia.north one half)
    -- ($(Vittorio Veneto.south two half)$)
    -- (Vittorio Veneto.two half)
    %% -- (Repubblica.two half)
    %% -- (Monte Santo.south one half)
    %% -- (Monte Santo.north one half)
    -- \centerarc(46:90:6.2)
    -- (Via Farini Via Ferrari.south two half)
    -- ++(0,.7)
    {[rounded corners=.3cm]
    -- ($(Via Ugo Bassi) + (-.3,0)$)
    }
    -- (Via Ugo Bassi)
    -- ++(.7,0) \makeStation(south, north, 0)(0,0){Via Porro |Lambertenghi}
    {[rounded corners=.3cm]
    -- ++(.8,0)
    }
    -- ($(Piazzale Lagosta.south one half)$)
    -- (Piazzale Lagosta.one half)
    ;
  \end{pgfonlayer}

  \begin{pgfonlayer}{labels}


    \foreach \stop/\stopanchor/\line/\anchor/\name in {
      Greco Rovereto/center/one/south/1,
      Roserio/north two half/one/south/1,
      Roserio-one-label/center/twelve/west/12,
      Bausan/center/two/south/2,
      Piazzale Negrelli/south/two/north/2,
      Duomo/two half/fifteen/north west/15,
      Duomo-fifteen-label/center/three/north/3,
      Via dei Missaglie Via Baroni/two half/three/south east/3,
      Niguarda Parco Nord/center/four/south/4,
      Ricasoli/center/four/east/4, % TODO
      Ortica/center/five/west/5,
      Ospedale Niguarda/center/five/east/5,
      Piazzale Lagosta/center/seven/east/7,
      Piazzale Lagosta-seven-label/center/thirtythree/east/33,
      Precotto Interno Deposito/center/seven/north/7,
      Centrale/west/nine/east/9,
      Porta Genova/center/nine/north/9,
      24 Maggio/center/ten/north east/10,
      Viale Lunigiana/two half/ten/west/10,
      Viale Molise/center/twelve/west/12,
      Piazzale Cimitero Maggiore/center/fourteen/east/14,
      Lorenteggio/center/fourteen/north east/14,
      Via Guido Rossa/center/fifteen/east/15,
      San Siro Stadio/center/sixteen/south/16,
      Via Monte Velino/east/sixteen/west/16,
      Stazione Lambrate/center/nineteen/south/19,
      Piazza Castelli/west/nineteen/north/19,
      Piazza Fontana/one half/twentyfour/east/24,
      Vigentino/center/twentyfour/east/24,
      Piazza Fontana/two half/twentyseven/west/27,
      Viale Ungheria/center/twentyseven/north/27,
      Primo Maggio/north/thirtyone/south/31,
      Viale Testi Via S Marcellina/one half/thirtyone/east/31,
      Rimembranze di Lambrate/east/thirtythree/west/33
    } {
      \node[label, line name, fill=\line, anchor=\anchor] (\stop-\line-label)
        at ($(\stop.\stopanchor)$)
        {\bf \name};
    };

    \foreach\stop/\stopanchor/\direction/\distance/\anchor/\rotate in {
      Cenisio/west/190/-.2/north east/0,
      Quinto Alpini/west/30/-.1/east/0,
      Missori/east/135/.2/south/0,
      Cordusio/north east/-90/.1/south west/0
    } {
      \node[label, rotate=\rotate, anchor=\anchor]
      at ($(\stop.\stopanchor) + (\direction:\distance)$)
           {\contour{white}{\stop}};
    };

    \node[label, anchor=east] at ($(DuomoN.west) + (-0.5,-.3)$)
         {\contour{white} {Duomo}};

    \foreach\stop/\stopanchor/\anchor/\rotate in {
      Cusani/east/west/0,
      Lanza/east/west/0,
      Crocetta/north east/west/0,
      Ricasoli/north/south/0,
      Arena/east/west/0,
      Piazza Fontana/north/south/0,
      Via Torino Via Palla/west/south east/0,
      Via Torino Via S Maria Valle/west/south east/0,
      Carrobbio/west/south east/0,
      Tricolore/west/east/0,
      % west
      San Siro Stadio/west/east/0,
      6 Febbraio/west/east/0,
      Viale Boezio/west/east/0,
      Domodossola/west/east/0,
      % north
      Bausan/west/east/0,
      Niguarda Parco Nord/west/east/0,
      Ca Granda/east/west/0,
      Marche/west/east/0,
      Greco Rovereto/east/west/0,
      Via Vitruvio/east/west/0,
      Viale Tunisia/south east/west/0,
      % east
      Stazione Lambrate/east/west/0,
      % south east
      Repetti/north/south/0,
      Viale Ungheria/east/west/0,
      % ring
      Porta Romana/east/west/0,
      Repubblica/two half/south west/0,
      Piazzale Aquileia/west/east/0
    } {
      \node[label, rotate=\rotate, anchor=\anchor]
      at ($(\stop.\stopanchor)$)
           {\contour{white}{\stop}};
    };

    \foreach \stop/\suffix/\position/\anchor/\rotate in {
      Viale Lunigiana/ten-label/.2/west/0,
      Ospedale Niguarda/five-label/-.2/east/0
    } {
      \node[label, rotate=\rotate, anchor=\anchor, align=center]
      at ($(\stop-\suffix) + (\position,0)$)
           {\contour{white}{\stop}};
    };

    \mlabel(north west, south east, 0, 180, .1){Piazzale Coni Zugna |Via Solari}
    \mlabel(east, south, 0, 0, -.3){Piazzale |Santorre |di Santarosa}
    \mlabel(east, south, 0, 0, 0){Via Mac Mahon |Via Artieri}
    \slabel(north, south){Piazzale |Cimitero Maggiore}
    \mlabel(west, north east, 0, 110, .5){Corso Sempione |Via Procaccini}
    \slabel(west, east){Via Farini |Viale Stelvio}
    \slabel(east, west){Viale Testi |Via S Marcellina}
    \slabel(east, west){Piazzale |Lagosta}
    \mlabel(west, north, 0, 0, -.4){Piazza |Diocleziano}
    \slabel(north west, east){Via Farini |Via Valtellina}
    \mlabel(one half, south east, 0, 45, 0){Via Farini |Via Ferrari}
    \slabel(north, south){Rimembranze |di Lambrate}
    \slabel(east, west){Monte Nero |Via Spartaco}
    \mlabel(north east, south west, 0, -45, .2){Viale Monte Nero |Via Bergamo}
    \mlabel(east, west, 0, -40, .2){Via Ripamonti |Viale Sabotino}
    \slabel(east, west){Piazza Abbiategrasso}
    \slabel(east, west){Via dei Missaglie Via Baroni}
    \mlabel(west, north, 0, 90, 0.05){Adalaide |di Savoia}
    \mlabel(north, south, 0, 0, 0){Precotto |Interno Deposito}
    \mlabel(north, south, 0, -180, 0){Castello |Cairoli}
    \mlabel(east, north, 0, 15, 0.3){Arco |della Pace}
    \mlabel(west, east, 0, -90, 0.15){Corso Sempione Via Canova}
    \mlabel(west, east, 0, 90, 0.05){Corso Sempione Via Villasanta}
    \mlabel(west, east, 0, -60, .4){Vittorio |Veneto}
    \slabel(west, north){Largo |d'Ancona}
    \mlabel(west, north, 0, 90, .05){Via |Meravigli}
    \mlabel(west, south east, 0, -45, .2){Corso Genova |Via Sapeto}
    \mlabel(east, west, 0, 0, 0){Corso Porta Romana |Via S Sofia}
    \mlabel(west, north, 0, 0, 0){Palazzo |di Guistizia}
    \mlabel(east, south, 0, 0, 0){Corso |Porta Vittoria |Camera |del Lavoro}
    \mlabel(west, north, 0, 0, .3){Via Larga}
    \mlabel(east, south, 0, 0, .3){Augusto}
    \mlabel(east, north, 0, 0, 0){Via 20 |Settembre}
    \mlabel(east, north, 0, 0, 0){Piazza |Virgilio}
    \mlabel(east, south west, 0, -70, .4){Lega |Lombarda}

    \slabel(east, west){Piazzale |Baiamonti}
    \slabel(east, west){Viale |Montello}
    \mlabel(west, north east, 0, 45, .4){Via |Bramante |Via Sarpi}
    \mlabel(north west, east, 0, -45, .1){Porta |Venezia}
    \mlabel(south two half, south west, 0, -45, 0.2){Monte |Santo}
    \mlabel(south east, south, 0, 90, .2){Via Vigenavo |Viale Gorizia}
    \mlabel(south east, north east, 0, 0, -.3){Porta |Genova}
    \mlabel(one half, north west, 0, 0, 0){24 |Maggio}
    \mlabel(north, south, 0, 0, 0){Viale Col |di Lana}
    \mlabel(north, south, 0, 0, -.2){Via |Bocconi}
    \mlabel(south, north, 0, 0, 0.2){Viale |Bligny}
    \mlabel(south east, north west, 0, -45, -0.1){Porta |Lodovica}
    \mlabel(east, west, 0, 0, 0){Viale Monte Nero |Via Pier Lombardo}
    \mlabel(east, west, 0, 0, 0){Viale Sabotino}
    \mlabel(one half, north west, 0, 70, 0.2){Piazza |5 Giornate}
    \mlabel(west, east, 0, 0, 0){Viale Coni Zugna |Via Foppa}
    \mlabel(west, east, 0, 0, 0){Viale San Michele del Carso |Piazza De Meis}
    \mlabel(south west, north east, 0, 0, 0){Piazzale |Baracca}
    \slabel(east, west){Conciliazone}
    \slabel(west, east){Via Arosto}
    \mlabel(west, south east, 0, -90, 0.1){Via Pagano |Via Canova}
    \mlabel(west, south east, 0, 40, 0){Piazza |Gramsci}
    \mlabel(south, north west, 0, -25, -.5){Via |Procaccini |Via Lomazzo}
    \mlabel(north west, south east, 0, -25, 0.3){Via Procaccini |Via Nono}
    \mlabel(south, north, 0, -40, 0.2){Monumentale}
    \mlabel(north east, south, 0, 90, 0.3){Piazzale |Cimitero |Monumentale |Via Bramante}

    \mlabel(east, south, 0, 0, 0){Stazione |Garibaldi}
    \mlabel(west, north, 0, 0, 0){Viale Monte |Grappa |Via Gioia}
    \mlabel(east, south, 0, 90, 0.2){Piazzale |Principessa |Clotilde |Ospedale |Fatebenefratelli}
    \mlabel(north, south, 0, 90, .1){Via |Guido Rossa}
    \slabel(east, west){Vigentino}
    \mlabel(west, north east, 0, -45, -.2){Piazzale |Cantore}
    \mlabel(north, south, 0, 90, .1){Viale |Molise}
    \slabel(east, south){Piazza |Emilia}
    \slabel(south, north){Via Monte |Velino}
    \slabel(east, west){Viale |Premuda}
    \slabel(south, north){Ortica}
    \mlabel(west, west, 0, 0, 0){Via Valvassori Peroni}
    \mlabel(east, west, 0, 0, 0){Porta Venezia |Viale Tunisia}
    \mlabel(west, east, 0, 0, 0){Piazza 8 |Novembre}
    \slabel(west, east){Viale |Piave}
    \slabel(east, west){Piazza Cincinnato}
    \mlabel(north, south, 0, 0, 0.3){Piazza Duca |d'Aosta}
    \mlabel(east, west, 0, 0, 0){Centrale |Via Tonale}
    \mlabel(north, south, 0, 0, 0){Via Ugo |Bassi}
    \mlabel(north, south, 0, 0, .1){Piazza |Carbonari}
    \mlabel(north, south, 0, 0, .2){Viale Lunigiana |Via Gioia}
    \slabel(south, north){Primo |Maggio}
    \slabel(east, south){Piazza |Castelli}
    \mlabel(west, north, 0, 0, -.4){Piazza |Firenze}
    \mlabel(east, south, 0, 0, 0){Piazzale |Accursio}
    \slabel(east, west){Roserio}
    \mlabel(west, east, 0, -90, .2){Viale Espinasse |Via Palizzi}
    \slabel(west, east){Lorenteggio}
    \slabel(south east, west){Piazzale Negrelli}
    \mlabel(north west, south, 0, -30, -.3){Centrale}


  \end{pgfonlayer}
\end{tikzpicture}

\end{document}
% vim: nospell conceallevel=0
