Dev:Connection between tracks: Difference between revisions

From railML 2 Wiki
Jump to navigation Jump to search
[unchecked revision][unchecked revision]
No edit summary
No edit summary
Line 51: Line 51:
= Insertion of a Switch =
= Insertion of a Switch =


[http://apmsrv034.apm.etc.tu-bs.de/simpleSwitch.png Here a situation is shown in which a second track is connection via a switch somewhere on another track (click for graphic).] The labels shown the figure have the following meaning:
[http://apmsrv034.apm.etc.tu-bs.de/simpleSwitch.png Here a situation is shown in which a second track is connected via a switch somewhere on another track (click for graphic).] The labels shown the figure have the following meaning:


* T1 = track 1
* T1 = track 1
Line 59: Line 59:
* C1 = Connection 1 from SW1 to TB2
* C1 = Connection 1 from SW1 to TB2
* C2 = Connection 2 from TB2 to SW1
* C2 = Connection 2 from TB2 to SW1
The relevant XML code for this example would be:
  <tracks>
    <track id="T1">
      <trackTopology>
        <trackBegin id="TB1">
          <...>
        </trackBegin>
        <trackEnd id="TE1">
          <...>
        </trackEnd>
      </trackTopology>
    </track>
    <track id="T2">
      <trackTopology>
        <trackBegin id="TB2">
          <connection id="C2" ref="C1"/>
        </trackBegin>
        <trackEnd id="TE2">
          <...>
        </trackEnd>
      </trackTopology>
    </track>
  </tracks>

Revision as of 18:20, 13 March 2010

Introduction

People just starting out with RailML are often puzzled how to store connections between track elements and how to model a simple switch. This page will show some examples and give some explanations on the preferred solutions for these problems. In detail, this page will show

  • the connection between two subsequent tracks
  • the insertion of a switch somewhere on a track
  • a crossover between two parallel tracks

along with fragmentary XML code snippets. In all code fragments, non relevant attributes or elements will be omitted for more clarity. Thus, the the code shown here cannot be validated against the XSDs.

Simple Connection Between Two Tracks

Imagine the following scenario, in which the tracks T1 and T2 shall be directly connected with each other (click for graphic). The labels shown the figure have the following meaning:

  • T1 = Track 1
  • T2 = Track 2
  • TE1 = trackEnd of track 1
  • TB2 = trackBegin of track 2
  • C1 = Connection 1 from TE1 to TB2
  • C2 = Connection 2 from TB2 to TE1

The relevant XML code for this example would be:

 <tracks>
   <track id="T1">
     <trackTopology>
       <trackBegin id="TB1">
         <...>
       </trackBegin>
       <trackEnd id="TE1">
         <connection id="C1" ref="C2"/>
       </trackEnd>
     </trackTopology>
   </track>
   <track id="T2">
     <trackTopology>
       <trackBegin id="TB2">
         <connection id="C2" ref="C1"/>
       </trackBegin>
       <trackEnd id="TE2">
         <...>
       </trackEnd>
     </trackTopology>
   </track>
 </tracks>

The code shows how the end of T1 is connected to the begin of T2 and vice versa. You certainly have noticed that this is a kind of "double linking" which is a possible source for inconsistencies. Therefore, it is crucial to all your XML files that the symmetry between two associated connections is kept. This constraint cannot be automatically checked by XML validators since it is a rule of RailML (the "application layer" on top of XML) and not of XML itself.

Insertion of a Switch

Here a situation is shown in which a second track is connected via a switch somewhere on another track (click for graphic). The labels shown the figure have the following meaning:

  • T1 = track 1
  • T2 = track 2
  • SW1 = switch 1 on track 1
  • TB2 = trackBegin of track 2
  • C1 = Connection 1 from SW1 to TB2
  • C2 = Connection 2 from TB2 to SW1

The relevant XML code for this example would be:

 <tracks>
   <track id="T1">
     <trackTopology>
       <trackBegin id="TB1">
         <...>
       </trackBegin>
       <trackEnd id="TE1">
         <...>
       </trackEnd>
     </trackTopology>
   </track>
   <track id="T2">
     <trackTopology>
       <trackBegin id="TB2">
         <connection id="C2" ref="C1"/>
       </trackBegin>
       <trackEnd id="TE2">
         <...>
       </trackEnd>
     </trackTopology>
   </track>
 </tracks>