Skip to content

IofControl

Types

controlType

The role a control plays on a course.

rescript
type controlType =
  | Start
  | Finish
  | Control
  | CrossingPoint
  | EndOfMarkedRoute

Constructors:

  • Start
  • Finish
  • Control
  • CrossingPoint
  • EndOfMarkedRoute

geoPosition

A georeferenced position using WGS84 coordinates from IOF GeoPosition.

rescript
type geoPosition = {
  lng: float,
  lat: float,
  alt: option<float>,
}

Fields:

  • lng: float
  • lat: float
  • alt: option&lt;float&gt;

mapPosition

A position in the map coordinate system.

rescript
type mapPosition = {
  x: float,
  y: float,
  unit: option<string>,
}

Fields:

  • x: float
  • y: float
  • unit: option&lt;string&gt;

t

A physical control on the terrain, identified by its control code.

See: Control in the IOF XML 3.0 XSD

rescript
type t = {
  id: string,
  punchingUnitIds: array<string>,
  name: option<string>,
  position: option<geoPosition>,
  mapPosition: option<mapPosition>,
  controlType: controlType,
  modifyTime: option<string>,
}

Fields:

  • id: string — The control code, e.g. "32".
  • punchingUnitIds: array&lt;string&gt; — Punching unit ids associated with this control.
  • name: option&lt;string&gt; — A human-readable control name, if supplied.
  • position: option&lt;geoPosition&gt; — The control's georeferenced position.
  • mapPosition: option&lt;mapPosition&gt; — The control's position in the map coordinate system.
  • controlType: controlType — The role this control plays.
  • modifyTime: option&lt;string&gt; — The IOF modifyTime attribute, if supplied.

Values

parseControlType

rescript
let parseControlType: string => controlType

controlTypeToString

rescript
let controlTypeToString: controlType => string

parseGeoPosition

rescript
let parseGeoPosition: IofXml.XmlUtils.xmlElement => option<geoPosition>

parseMapPosition

rescript
let parseMapPosition: IofXml.XmlUtils.xmlElement => option<mapPosition>

parse

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