CARIS Easy View : Support Files Guide : Mapping : Mapping File Structure : Attribute Mapping
 

Attribute Mapping

Attribute mappings are contained between the <AttributeMappings> tags. This section can contain one or more attribute mapping instructions.

Attribute mapping instructions can also be included in the <ObjectMappings> section. If you do this, you must still include the opening and closing tags in the file: <AttributeMappings></AttributeMappings>

A match is made from the first matching entry in the file. Therefore, your entries must be ordered from the most specific to the least specific.

The basic structure of the Attribute Mapping section is displayed below.

<AttributeMappings>

  <MapAttribute Name="UniqueNameOfAttributeMapping">

    <Entry>

      <Filter>

        <FilterName Parameters="ParameterValue"/>

      </Filter>

      <AttributeAssignmentAction Parameters="ParameterValue"/>

    </Entry>

  </MapAttribute>

</AttributeMappings>

The following table describes the tags in the <AttributeMappings> section.

Tag

Description

Status

<MapAttribute>

The <MapAttribute> tag contains all elements needed to map from one attribute to another. The attribute mapping must contain a unique "Name" property.

Mandatory

<Entry>

The <Entry> tag describes the mapping. There can be more than one <Entry> tag. The Filter and Action tags are contained within this tag. An <Entry> tag can contain more than one <Filter> or <Action> tag.

During the mapping process, the application will choose the first entry with a criteria that matches the list of attributes to be converted.

Mandatory

<Filter>

The <Filter> tag determines if the attributes being mapped met the criteria set in the <FilterName> tag. A filter can be simple or complex using conditional and logical operators.

Optional

Attribute mapping example 1

In the following example, the S-57 OBJNAM (object name) attribute is mapped to the VPF NAM attribute.

<MapAttribute Name="OBJNAMtoNAM">

  <Entry>

    <Filter>

      <AttributeValueIsUndefined Acronym="OBJNAM"/>

    </Filter>

    <SetAttributeValue Acronym="NAM" Value="UNK" />

  </Entry>

 

  <Entry>

    <Filter>

      <AttributeValueIsUnknown Acronym="OBJNAM" />

    </Filter>

    <SetAttributeValue Acronym="NAM" Value="UNK" />

  </Entry>

 

  <Entry>

    <CopyAttributeValue FromAcronym="OBJNAM" ToAcronym="NAM" />

  </Entry>

</MapAttribute>

In the above attribute mapping (OBJNAMtoNAM), the OBJNAM attribute must go through three steps prior to being imported into the workspace.

The first entry will set NAM="UNK" if OBJNAM is undefined.

The second entry will set NAM="UNK" if OBJNAM is unknown.

The third entry copies OBJNAM’s value to NAM.

Two entries use filters. If the test passes, then matching action is taken. There is no filter in the third entry, so attributes automatically match. This structure uses the concept of working from the more specific matches to the less specific matches.

Note you cannot map the same attributes twice in a single mapping file. For example, you cannot map from attribute A to attribute B and then from B to attribute C. You can map from attribute A to attribute B in one mapping file and then map from B to C in another file.

Attribute mapping example 2

In this example, an S-100 SignalSequence attribute is mapped to an S-57 SIGSEQ attribute.

<MapAttribute Name="signalSequencetoSIGSEQ" RepeatForEach="signalSequence">

  <Entry>

    <Filter>

      <AttributeValueIsEqualTo Acronym="signalSequence/signalStatus" Value="1"/>

    </Filter>

    <CopyAttributeValue FromAcronym="signalSequence/signalDuration" ToAcronym="SIGSEQ" Append="True" Separator="+" Precision="2"/>

  </Entry>

</MapAttribute>

For each signalSequence complex attribute, the <MapAttribute> function checks if the signalStatus value is 1. If so, the value of the signalDuration attribute is copied to the S-57 SIGSEQ attribute.

This process is repeated for each instance of SignalSequence. For example, if there are four signalSequence attributes then the same attribute mapping is repeated for all four.