Defining Custom Units

FME defines a large number of units (for example, meters, US feet, degrees, radians, etc.).  If your coordinate system is measured in a unit that FME does not already know about, you can define the new unit.

Unit definitions may occur in an FME mapping file, as well as in the file:

LocalCoordSysDefs.fme

The syntax of a unit definition is:

UNIT_DEF <unit name> \
    UNIT_TYPE <unit type> \
    UNIT_ABBREVIATION <unit abbreviation> \
    UNIT_FACTOR <unit size>

Name

Range

Description

Optional

<unit name>

any string

The name of the unit being defined.

No

<unit type>

ANGLE | LENGTH

Specifies whether the unit measures angles or lengths.

No

<unit abbreviation>

any string

This abbreviation represents the unit and may be used in coordinate system definitions instead of the <unitname>.

No

<unit size>

Floating-point number

The size of a unit in metres if it measures length. If the unit measures angle, then this is the size in degrees.

No

Example Unit Definition

In this example, we define the unit “GRIDUNIT” (abbreviated as “GRD”) where the unit length is 0.999738 meters.

UNIT_DEF GRIDUNIT  \
    UNIT_TYPE LENGTH  \
    UNIT_ABBREVIATION GRD   \
    UNIT_FACTOR 0.999738