Home » railML newsgroups » railml.infrastructure » How to mark the end of a speed restriction?
How to mark the end of a speed restriction? [message #559] Thu, 12 June 2014 07:30 Go to next message
Christian Rahmig is currently offline  Christian Rahmig
Messages: 151
Registered: January 2011
Senior Member
Dear railML users,

brought up by Dirk Bräuer from iRFP we discussed the question: How to
model the end of a speed restriction?
The idea was to use the <speedChange> element as follows:

<speedChange id="sc7" pos="256.7" vMax="end" dir="up" />

The problem resulting from this approach relates to the data type that
is used for defining the maximum speed, tSpeed. Currently, it does not
support the mix of numeric values with other entries. A quick solution
can be to define vMax="-1" as the valid expression for the end of a
speed restriction. What is your opinion about this idea?

[1] https://trac.railml.org/ticket/41

Best regards

--
Christian Rahmig
railML.infrastructure coordinator
Re: How to mark the end of a speed restriction? [message #1228 is a reply to message #559] Thu, 12 June 2014 23:32 Go to previous messageGo to next message
Susanne Wunsch is currently offline  Susanne Wunsch
Messages: 180
Registered: March 2008
Senior Member
Hi Christian,

Christian Rahmig <coord(at)infrastructurerailmlorg> writes:
>
> brought up by Dirk Bräuer from iRFP we discussed the question: How to
> model the end of a speed restriction?
> The idea was to use the <speedChange> element as follows:
>
> <speedChange id="sc7" pos="256.7" vMax="end" dir="up" />
>
> The problem resulting from this approach relates to the data type that
> is used for defining the maximum speed, tSpeed. Currently, it does not
> support the mix of numeric values with other entries.

Why not to enhance this type with an xs:union and restricted xs:string
for the xs:enumeration value "end"? It would be the same way, as already
done with "rail:tOtherEnumerationValue".

Kind regards...
Susanne

--
Ingenieurbüro gleisBezug; Susanne Wunsch; +49-351-46927070
Adresse: Schrammsteinstraße 8; 01309 Dresden; Ust-Id: DE273670238
Re: How to mark the end of a speed restriction? [message #1229 is a reply to message #1228] Fri, 20 June 2014 07:15 Go to previous messageGo to next message
Christian Rahmig is currently offline  Christian Rahmig
Messages: 151
Registered: January 2011
Senior Member
Dear Susanne,

Am 12.06.2014 23:32, schrieb Susanne Wunsch:
> [...]
>
> Why not to enhance this type with an xs:union and restricted xs:string
> for the xs:enumeration value "end"? It would be the same way, as already
> done with "rail:tOtherEnumerationValue".

Thank you very much for your input. And this is how I implemented:
I introduced a new simple data type "tVMax", which may contain a speed
value in kmph as well as the string value "end":

<xs:simpleType name="tVMax">
<xs:union>
<xs:simpleType>
<xs:restriction base="rail:tSpeedKmPerHour" />
</xs:simpleType>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="end" />
</xs:restriction>
</xs:simpleType>
</xs:union>
</xs:simpleType>

The speedChange's attribute @vMax uses this data type.

I hope this solution solves the problem with the undefined maximum speed
at the end of a temporary speed restriction zone and I appreciate your
comments about it...

Best regards

--
Christian Rahmig
railML.infrastructure coordinator
Re: How to mark the end of a speed restriction? [message #1230 is a reply to message #1229] Fri, 20 June 2014 09:03 Go to previous messageGo to next message
Susanne Wunsch is currently offline  Susanne Wunsch
Messages: 180
Registered: March 2008
Senior Member
Hi Christian,

Christian Rahmig <coord(at)infrastructurerailmlorg> writes:
>
> <xs:simpleType name="tVMax">
> <xs:union>
> <xs:simpleType>
> <xs:restriction base="rail:tSpeedKmPerHour" />
> </xs:simpleType>
> <xs:simpleType>
> <xs:restriction base="xs:string">
> <xs:pattern value="end" />
> </xs:restriction>
> </xs:simpleType>
> </xs:union>
> </xs:simpleType>
>
> The speedChange's attribute @vMax uses this data type.
>
> I hope this solution solves the problem with the undefined maximum
> speed at the end of a temporary speed restriction zone and I
> appreciate your comments about it...

Great!

You have chosen the regular expression option in XML schema. I would
admit, that there is another possibility to define the value "end",
allowing to comment this value:

<xs:enumeration value="end" >
<xs:annotation>
<xs:documentation>The value 'end' should be used for temporary
speed restrictions, otherwise define the next speed aspect.</xs:documentation>
</xs:annotation>
</xs:enumeration>

The railML schemas currently use the regular expression method only in
cases, where there is no XML schema alternative, e.g. constraining the
"other-enumeration-value".

See also http://stackoverflow.com/questions/13974148/pattern-vs-enume ration-in-schema-xml

Kind regards...
Susanne

--
Ingenieurbüro gleisBezug; Susanne Wunsch; +49-351-46927070
Adresse: Schrammsteinstraße 8; 01309 Dresden; Ust-Id: DE273670238
Re: How to mark the end of a speed restriction? [message #1231 is a reply to message #1230] Fri, 20 June 2014 11:22 Go to previous message
Christian Rahmig is currently offline  Christian Rahmig
Messages: 151
Registered: January 2011
Senior Member
Dear Susanne,

Am 20.06.2014 09:03, schrieb Susanne Wunsch:
> [...]
>
> You have chosen the regular expression option in XML schema. I would
> admit, that there is another possibility to define the value "end",
> allowing to comment this value:
>
> <xs:enumeration value="end" >
> <xs:annotation>
> <xs:documentation>The value 'end' should be used for temporary
> speed restrictions, otherwise define the next speed aspect.</xs:documentation>
> </xs:annotation>
> </xs:enumeration>
>
> The railML schemas currently use the regular expression method only in
> cases, where there is no XML schema alternative, e.g. constraining the
> "other-enumeration-value".
>
> See also http://stackoverflow.com/questions/13974148/pattern-vs-enume ration-in-schema-xml
>
> Kind regards...
> Susanne
>

thank you very much for your clarification on the topic. Indeed, the
enumeration solution seems to be better understandable. Therefore I
implemented it in SVN revision 609.

Best regards

--
Christian Rahmig
railML.infrastructure coordinator
Previous Topic: meaning of 'up' and 'down' in mileageChange.dir and track.mainDir
Next Topic: Modelling transition bends
Goto Forum:
  


Current Time: Wed Aug 16 21:15:16 CEST 2017