Dev:Splitting and merging railML files

From railML 3 Wiki
Revision as of 17:30, 9 September 2024 by RailML Orga Ontology (talk | contribs) (formatting)
Jump to navigation Jump to search

Introduction

This is a guide on splitting and merging railML files.

Problem statement

Users have a big file with railway network and lines in it. Reading software may not support importing this big file. Users want to extract lines from the network to separate files and then (after import) to bring lines back into one network. Splitting and merging of lines may be done by different parties and different tools.

Railway sector actors should be able to prepare their data for splitting and integration in a unified standardized way i.e. split files into (lines) parts intended for integration in an automated way, define explicit points for connection.

General concept

2024-09-09 railML splittingConcept.svg

Connector <netElement> is a redundant <netElement> marking a “border” of a file. It exists in both files after splitting.

Splitting between <netElement>s

Splitting network into lines

No overlap

Overlap within a station

Line into line sections and station

Splitting one <netElement> into two <netElement>s

In the Simple example (link to the railML® website) there is only one <netElement> corresponding to the line section between Arnau and Cstadt. This means that net element should be split and replaced by two net elements.

In between of two split net elements a connector <netElement> should be inserted.

If splitting at linear coordinate 2500 then:

- every functional IS with coordinate ≤ 2500 should be extracted to file1;

- every functional IS with coordinate > 2500 should be extracted to file2;

- netElement1 beginning at milage 700 end ending at mileage 2500 should be added in file1;

- netElement2 beginning at milage 2500 end ending at mileage 4300 should be added in file2;

- connector2 should be inserted in the end of netElement1 in file1;

- connector2 should be inserted in the beginning of netElement1 in file2.

Initial net element will be lost.

Lets see an example of splitting line section into two parts. Furthermore line section was already extracted in the previous step, therefore input file already includes connectors.

2024-09-09 railML splittingNetElementIntoParts.svg

Input file

<?xml version="1.0" encoding="UTF-8"?>
<railML xmlns="https://www.railml.org/schemas/3.1" 
        xmlns:dc="http://purl.org/dc/elements/1.1/"
        xmlns:gml="http://www.opengis.net/gml/3.2/"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="https://www.railml.org/schemas/3.1 https://www.railml.org/schemas/3.1/railml3.xsd"
        version="3.1">
  <metadata>
    <dc:format>3.1</dc:format>
    <dc:identifier>3</dc:identifier>
    <dc:source>railML.org</dc:source>
    <dc:title xml:lang="en">Simple Example v12 railML 3.1</dc:title>
    <dc:language>en</dc:language>
    <dc:creator xml:lang="de">railML.org</dc:creator>
    <dc:creator xml:lang="de">Dr. Jörg von Lingen</dc:creator>
    <dc:description>This example file has been coded manually and therefore may not be free of errors.</dc:description>
    <dc:rights>Copyright (c) railML.org e.V. Dresden/Germany; All Rights Reserved.
      This work is licensed under the restricted CreativeCommons Attribution-NonCommercial-NoDerivatives 4.0 International License with additional license conditions of railML.org.
      For further information see: https://www.railml.org/licence
      Content of this file: railML 3.1 Simple Example</dc:rights>
  </metadata>
<!-- Bf Arnau covers net element a11 and Bf Cstadt covers b11. a11 and b11 are both linked to x11. Thus in this file x11 
and all the topology aggregated into x11 and all the functional IS referring to 
x11 and aggregated topology are extracted from Simple example -->
  <common id="co_01">
    <organizationalUnits>
      <infrastructureManager id="im_01" code="SZDC"/>
    </organizationalUnits>
    <speedProfiles>
      <speedProfile id="spp01" influence="increasing"></speedProfile>
    </speedProfiles>
    <positioning>
<!-- linear positioning system should have UUID and be consistent with semantic constraint IS 016 -->
      <linearPositioningSystems>
        <linearPositioningSystem id="lps01" units="m" startMeasure="0.0" endMeasure="5000.0" linearReferencingMethod="absolute">
          <name name="railway line 6869 mileage" language="en"/>
          <isValid from="2018-01-01" to="2018-12-31"/>
        </linearPositioningSystem>
      </linearPositioningSystems>

    </positioning>
  </common>
  
  <infrastructure id="is_01">
    <topology>
      <netElements>

        <netElement id="ne_x01" length="3600.0">
          <relation ref="nr_ne_x01connector1"/>
          <relation ref="nr_connector3ne_x01"/>
          <associatedPositioningSystem id="ne_x01_aps01">
            <intrinsicCoordinate id="ne_x01_aps01_ic01" intrinsicCoord="0">
              <linearCoordinate positioningSystemRef="lps01" measure="700.0"/>
            </intrinsicCoordinate>
            <intrinsicCoordinate id="ne_x01_aps01_ic02" intrinsicCoord="1">
              <linearCoordinate positioningSystemRef="lps01" measure="4300.0"/>
            </intrinsicCoordinate>
          </associatedPositioningSystem>
        </netElement>

        <!-- connector net elements of microscopic level-->
        <netElement id="connector1">
          <relation ref="nr_ne_x01connector1"/>
          <associatedPositioningSystem id="connector1_aps01">
            <intrinsicCoordinate id="connector1_aps01_ic01" intrinsicCoord="0">
            </intrinsicCoordinate>
          </associatedPositioningSystem>
        </netElement>
				
        <netElement id="connector3">
          <relation ref="nr_connector3ne_x01"/>
          <associatedPositioningSystem id="connector3_aps01">
            <intrinsicCoordinate id="connector3_aps01_ic01" intrinsicCoord="0">
            </intrinsicCoordinate>
          </associatedPositioningSystem>
        </netElement>

        <netElement id="ne_x11">
          <relation ref="nr_ne_x11connector2"/>
          <relation ref="nr_connector4ne_x11"/>
          <elementCollectionOrdered id="ne_x11_ecu01">
            <elementPart ref="ne_x01"/>
          </elementCollectionOrdered>
          <associatedPositioningSystem id="ne_x11_aps01">
            <intrinsicCoordinate id="ne_x11_aps01_ic01" intrinsicCoord="0">
              <linearCoordinate measure="700.0" positioningSystemRef="lps01"/>
            </intrinsicCoordinate>
            <intrinsicCoordinate id="ne_x11_aps01_ic02" intrinsicCoord="1">
              <linearCoordinate measure="4300.0" positioningSystemRef="lps01"/>
            </intrinsicCoordinate>
            <isValid from="2018-01-01" to="2018-12-31" />
          </associatedPositioningSystem>
        </netElement>

        <!-- connector net elements of mesoscopic level-->
        <netElement id="connector2">
          <relation ref="nr_ne_x11connector2"/>
					<!-- connector net element of mesoscopic level aggregates the one of microscopic level -->
          <elementCollectionOrdered id="connector2_ecu01">
            <elementPart ref="connector1"/>
          </elementCollectionOrdered>
          <associatedPositioningSystem id="connector2_aps01">
            <intrinsicCoordinate id="connector2_aps01_ic01" intrinsicCoord="0">
            </intrinsicCoordinate>
            <isValid from="2018-01-01" to="2018-12-31" />
          </associatedPositioningSystem>
        </netElement>

        <netElement id="connector4">
          <relation ref="nr_connector4ne_x11"/>
					<!-- connector net element of mesoscopic level aggregates the one of microscopic level -->
          <elementCollectionOrdered id="connector4_ecu01">
            <elementPart ref="connector3"/>
          </elementCollectionOrdered>
          <associatedPositioningSystem id="connector4_aps01">
            <intrinsicCoordinate id="connector4_aps01_ic01" intrinsicCoord="0">
            </intrinsicCoordinate>
            <isValid from="2018-01-01" to="2018-12-31" />
          </associatedPositioningSystem>
        </netElement>
      </netElements>

      <netRelations>
        <!-- connector net relations of microscopic level-->
        <netRelation id="nr_ne_x01connector1" positionOnA="0" positionOnB="1" navigability="Both">
          <elementA ref="ne_x01"/>
          <elementB ref="connector1"/>
        </netRelation>
        <netRelation id="nr_connector3ne_x01" positionOnA="0" positionOnB="1" navigability="Both">
          <elementA ref="connector3"/>
          <elementB ref="ne_x01"/>
        </netRelation>				
        <!-- connector net relations of mesoscopic level-->
        <netRelation id="nr_ne_x11connector2" positionOnA="0" positionOnB="1" navigability="Both">
          <elementA ref="ne_x11"/>
          <elementB ref="connector2"/>
        </netRelation>
        <netRelation id="nr_connector4ne_x11" positionOnA="0" positionOnB="1" navigability="Both">
          <elementA ref="connector4"/>
          <elementB ref="ne_x11"/>
        </netRelation>
			</netRelations>

      <networks>
        <network id="nw01">
          <level id="lv0" descriptionLevel="Micro">

            <networkResource ref="ne_x01"/>
            <networkResource ref="connector1"/>
            <networkResource ref="connector3"/>
						
            <networkResource ref="nr_ne_x01connector1"/>
            <networkResource ref="nr_connector3ne_x01"/>

						
          </level>
          <level id="lv1" descriptionLevel="Meso">

            <networkResource ref="ne_x11"/>
            <networkResource ref="connector2"/>
            <networkResource ref="connector4"/>

            <networkResource ref="nr_ne_x11connector2"/>
            <networkResource ref="nr_connector4ne_x11"/>
          </level>
        </network>
      </networks>
    </topology>
    
    <geometry>
    </geometry>
    
    <functionalInfrastructure>

      

      
      <levelCrossingsIS>
        <levelCrossingIS id="lcr01" activation="infrastructureAutomatic">
          <name name="LX Arnau Cstadt" language="en"/>
          <spotLocation id="lcr01_sloc01" netElementRef="ne_x01" applicationDirection="both" pos="1800.0">
            <linearCoordinate positioningSystemRef="lps01" measure="2500.00"/>
          </spotLocation>
          <protection barriers="singleHalfBarrier" lights="none" acoustic="none"/>
        </levelCrossingIS>
      </levelCrossingsIS>
      
      <lines>
        <line id="lin01" lineCategory="other:CE" lineType="mainLine" infrastructureManagerRef="im_01">

          <linearLocation id="lin01_lloc01" applicationDirection="both">
<!-- associated net elements referring to a11 b11 are not extracted because are not aggregated into a11. 
Thus line and all the children should have UUIDs or keys for successful merge -->
            <associatedNetElement netElementRef="ne_x11" keepsOrientation="true">
              <linearCoordinateBegin positioningSystemRef="lps01" measure="700.0"/>
              <linearCoordinateEnd positioningSystemRef="lps01" measure="4300.0"/>
            </associatedNetElement>

          </linearLocation>
          <beginsInOP ref="opp01"/>
          <endsInOP ref="opp02"/>
          <lineLayout numberOfTracks="single"/>
          <linePerformance usablePlatformLength="200" maxSpeed="80">
            <allowedLoadingGauge ref="log01"/>
          </linePerformance>
        </line>
      </lines>
      
<!-- loading gauge is extracted because line refers to it -->
      <loadingGauges>
        <loadingGauge id="log01" code="GA"/>
      </loadingGauges>
<!-- opp01 and opp02 are extracted because line from beginsInOp and endsInOp refers to it. Thus should have UUIDs -->

      <operationalPoints>
        <operationalPoint id="opp01">
        </operationalPoint>
        <operationalPoint id="opp02">
        </operationalPoint>
      </operationalPoints>
      
      <signalsIS>

        <signalIS id="sig07" isSwitchable="true">
          <name name="69Va" language="en"/>
          <spotLocation id="sig07_sloc01" netElementRef="ne_x01" applicationDirection="normal" pos="2900.0">
            <linearCoordinate positioningSystemRef="lps01" measure="3600.0" lateralDistance="2.2" lateralSide="right"/>
          </spotLocation>
          <isTrainMovementSignal/>
        </signalIS>

        <signalIS id="sig11" isSwitchable="false">
          <spotLocation id="sig11_sloc01" netElementRef="ne_x01" applicationDirection="normal" pos="1300.0">
            <linearCoordinate positioningSystemRef="lps01" measure="2000.0" lateralDistance="2.2" lateralSide="right"/>
          </spotLocation>
          <isSpeedSignal type="announcement" trainRelation="headOfTrain">
            <refersToBeginOfSpeedSection ref="sps03"/>
          </isSpeedSignal>
        </signalIS>
        <signalIS id="sig12" isSwitchable="false">
          <spotLocation id="sig12_sloc01" netElementRef="ne_x01" applicationDirection="normal" pos="1700.0">
            <linearCoordinate positioningSystemRef="lps01" measure="2400.0" lateralDistance="2.2" lateralSide="right"/>
          </spotLocation>
          <isSpeedSignal type="execution" trainRelation="headOfTrain">
            <refersToBeginOfSpeedSection ref="sps03"/>
          </isSpeedSignal>
        </signalIS>
        <signalIS id="sig13" isSwitchable="false">
          <spotLocation id="sig13_sloc01" netElementRef="ne_x01" applicationDirection="normal" pos="1850.0">
            <linearCoordinate positioningSystemRef="lps01" measure="2550.0" lateralDistance="2.2" lateralSide="right"/>
          </spotLocation>
          <isSpeedSignal type="execution" trainRelation="endOfTrain">
            <refersToEndOfSpeedSection ref="sps03"/>
          </isSpeedSignal>
        </signalIS>
      </signalsIS>
      
      <speeds>
        <speedSection id="sps01" maxSpeed="80" isTemporary="false" isSignalized="true">
          <linearLocation id="sps01_lloc01" applicationDirection="normal">

<!-- associated net elements referring to a03, b03 and b01 are not extracted because are not aggregated into x11. 
Thus speed section and all the children should have UUIDs or keys for successful merge -->
            <associatedNetElement netElementRef="ne_x01" keepsOrientation="true">
              <linearCoordinateBegin positioningSystemRef="lps01" measure="700.0"/>
              <linearCoordinateEnd positioningSystemRef="lps01" measure="4300.0"/>
            </associatedNetElement>

          </linearLocation>
          <validForSpeedProfile ref="spp01"/>
        </speedSection>
        <speedSection id="sps02" maxSpeed="80" isTemporary="false" isSignalized="true">
          <linearLocation id="sps02_lloc01" applicationDirection="reverse">
<!-- associated net elements referring to a03, b03 and a01 are not extracted because are not aggregated into x11. 
Thus speed section and all the children should have UUIDs or keys for successful merge -->
            <associatedNetElement netElementRef="ne_x01" keepsOrientation="true">
              <linearCoordinateBegin positioningSystemRef="lps01" measure="4300.0"/>
              <linearCoordinateEnd positioningSystemRef="lps01" measure="700.0"/>
            </associatedNetElement>

          </linearLocation>
        </speedSection>
        <speedSection id="sps03" maxSpeed="20" isTemporary="true" isSignalized="true">
          <isValid from="2018-12-15" to="2018-12-22"/>
          <linearLocation id="sps03_lloc01" applicationDirection="normal">
            <associatedNetElement netElementRef="ne_x01" keepsOrientation="true">
              <linearCoordinateBegin positioningSystemRef="lps01" measure="2400.0"/>
              <linearCoordinateEnd positioningSystemRef="lps01" measure="2550.0"/>
            </associatedNetElement>
          </linearLocation>
        </speedSection>
      </speeds>
<!-- swi01 and swi02 are extracted because track from trackBegin and trackEnd refers to it. Thus should have UUIDs -->
      <switchesIS>
        <switchIS id="swi01">
        </switchIS>
        <switchIS id="swi02">
        </switchIS>

      </switchesIS>
      
      <tracks>

        <track id="trc03" type="mainTrack">
          <linearLocation id="trc03_lloc01" applicationDirection="both">

            <associatedNetElement netElementRef="ne_x01" keepsOrientation="true" sequence="2" posBegin="0.0" posEnd="3600.0">
            </associatedNetElement>
<!-- associated net elements referring to a01 b03 are not extracted because are not aggregated into x11. 
Thus track and all the children should have UUIDs or keys for successful merge -->
          </linearLocation>
          <trackBegin ref="swi01"/>
          <trackEnd ref="swi02"/>
          <length value="4000.0" type="physical"/>
        </track>

      </tracks>
      
      <trainDetectionElements>

        <trainDetectionElement id="tde12" type="axleCounter">
          <spotLocation id="tde12_sloc01" netElementRef="ne_x01" applicationDirection="both" pos="1700.0">
            <linearCoordinate positioningSystemRef="lps01" measure="2400.0" lateralSide="left"/>
          </spotLocation>
        </trainDetectionElement>
        <trainDetectionElement id="tde13" type="axleCounter">
          <spotLocation id="tde13_sloc01" netElementRef="ne_x01" applicationDirection="both">
            <linearCoordinate positioningSystemRef="lps01" measure="2550.0" lateralSide="left"/>
          </spotLocation>
        </trainDetectionElement>
      </trainDetectionElements>
    </functionalInfrastructure>

    <infrastructureStates>
      <infrastructureState id="iss01" value="operational">
        <name name="operational infrastructure 2018" language="en"/>
        <elementState id="ess01" refersToElement="lcr01" value="operational">
          <name name="levelCrossing in operation" language="en"/>
          <validityTime>
            <periodBitmask fromDate="2018-01-01" bitmask="1111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100111110011111001111100">
              <periodRule>
                <period from="06:00:00" to="22:00:00"/>
              </periodRule>
            </periodBitmask>
          </validityTime>
        </elementState>
      </infrastructureState>
    </infrastructureStates>
    
  </infrastructure>
  

</railML>


Splitting functional infrastructure entities with linear location