Skip to content

IofCourse

Types

courseControl

A single control visit on a course, referencing a control by id.

rescript
type courseControl = {
  controlId: string,
  controlIds: array<string>,
  controlType: option<string>,
  order: option<int>,
  mapText: option<string>,
  mapTextPosition: option<IofXml.IofControl.mapPosition>,
  legLength: option<float>,
  score: option<int>,
  randomOrder: option<bool>,
  specialInstruction: option<string>,
  tapedRouteLength: option<float>,
  modifyTime: option<string>,
}

Fields:

  • controlId: string — The id of the referenced control.
  • controlIds: array&lt;string&gt; — All referenced control ids; multiple ids represent alternative controls.
  • controlType: option&lt;string&gt; — The type of control, e.g. "Start", "Finish", or "Control".
  • order: option&lt;int&gt; — The visiting order of this control on the course.
  • mapText: option&lt;string&gt; — Text printed next to the control circle.
  • mapTextPosition: option&lt;IofXml.IofControl.mapPosition&gt; — Position of mapText in the map coordinate system.
  • legLength: option&lt;float&gt; — Length in metres from the previous control to this control.
  • score: option&lt;int&gt; — Score value for score-orienteering controls.
  • randomOrder: option&lt;bool&gt; — Whether this control belongs to an arbitrary-order block.
  • specialInstruction: option&lt;string&gt; — Special instruction from the IOF specialInstruction attribute.
  • tapedRouteLength: option&lt;float&gt; — Taped route length from the IOF tapedRouteLength attribute.
  • modifyTime: option&lt;string&gt; — The IOF modifyTime attribute, if supplied.

t

Defines a course — its name, length, climb, and the ordered sequence of controls.

See: Course in the IOF XML 3.0 XSD

rescript
type t = {
  id: option<string>,
  name: option<string>,
  courseFamily: option<string>,
  length: option<float>,
  climb: option<float>,
  numberOfControls: option<int>,
  mapId: option<string>,
  controls: array<courseControl>,
}

Fields:

  • id: option&lt;string&gt; — The identifier of the course.
  • name: option&lt;string&gt; — The name of the course.
  • courseFamily: option&lt;string&gt; — The course family used to group forked courses.
  • length: option&lt;float&gt; — The length of the course in metres.
  • climb: option&lt;float&gt; — The climb of the course in metres.
  • numberOfControls: option&lt;int&gt; — The number of controls on the course, excluding start and finish.
  • mapId: option&lt;string&gt; — Reference to the map used for this course.
  • controls: array&lt;courseControl&gt; — The ordered sequence of controls on the course.

Values

parseBool

rescript
let parseBool: string => option<bool>

parse

rescript
let parse: IofXml.XmlUtils.xmlElement => option<t>