Skip to content

Notes on .ocd format and Mapper compatibility

Libor Pecháček edited this page Jul 15, 2022 · 9 revisions

The .ocd file format for orienteering maps is a proprietary binary format partly documented at ocad.com web pages. Given its prevalence and long history, Mapper is able to import and export maps in this file format. This page tries to complement the official format documentation, point out its undocumented features, and show where Mapper lacks functionality to support all the features.

Open questions

Corner points

On plain dashed lines (e.g. ISOM path) or solid lines with mid-symbols (fence), the corner point makes the viewer render full dash/segment length on both sides of the point. Mapper does not support corner points in v0.9.5.

Dash points on dashed lines with mid-symbol

On dashed lines with mid-symbols (ruined fence, ruined wall), dash points behave like corner points. That is, a full-length dash is applied around the point. It's an undocumented inconsistency. Mapper places the mid symbol at the dash point in v0.9.5.

image

Dash points at line ends

.ocd supports dash points at line ends. That makes the start and/or end dash half in length. It helps to make neat ellipses with the dashed lines like form lines. Mapper does not allow dash points on the line ends as of v0.9.5.

Illustration of dash points at line ends:

image

Sideline cuts and virtual gaps

.ocd file format supports cutting sides of double-line symbols. That is, either the left, right, or both sidelines can be removed on a part of an object without splitting the object itself. Later format versions added the possibility to cut the object without interrupting the underlying carrier line. In other words, it could be called a "centerline cut" and in the file format terminology, it's called a "virtual gap". Mapper does not support any kind of these cuts in v0.9.5 although the virtual gap feature is on the roadmap (issue 150).

Cut circles in point objects

TBA (issue 2003)

Graphic objects

TBA (issue 959)

Layout objects

TBA

Parameter strings

Although the parameter strings are formatted in a uniform way and the letters seem to be documented, sometimes it's unclear how to interpret the values. Namely, the docs talk about the "grid and zone" number in the scales and georeferencing string but the meaning of the number is unknown (they are neither EPSG numbers nor any other standard reference). Another instance is the omega and phi angles in the template map settings.

Area symbol irregular patterns

The docs say that patterns can be distributed irregularly in an area. The distribution is controlled by StructIrregularVarX, StructIrregularVarY, StructIrregularMinDist TAreaSym members. The distribution function to make the irregular pattern has, however, not been specified.

Solved puzzles

Object and area pattern rotation

In .ocd all objects can be rotated, regardless of their symbol's north orientation settings. The symbol north orientation comes into play only during map rotation when objects with the "north orientation" may be excluded from the rotation while the other ones have their pattern and per-object rotation adjusted. Mapper implements the symbol north orientation as zero angle against the north. That is, there is a conceptual difference between Mapper and the .ocd feature. (issue 1926)

.ocd v8 icon compression

The docs say that the symbol icons can be compressed when a flag bit is set. However, the compression is not specified. It turns out to be GIF variant of LZW. (PR 1129)

Object creation and modification dates

The specs indicate the file structure positions and types of the data members representing the object creation and modification dates. However, the conversion function from the float to date is not specified. The hint that OCAD is written in Delphi leads to https://docwiki.embarcadero.com/Libraries/Alexandria/en/System.TDateTime that indeed specifies the conversion function.