CARIS HIPS and SIPS Help : Support Files Guide : Mapping : Mapping Functions
 

Mapping Functions

 
Many-to-One Mapping
One-to-Many Mapping

A set of functions are used to map from one object to another. These functions may simply create part of the new object (that is, set the acronym), or use information from the object being mapped to create the mapping.

The following table lists the available mapping functions.

Function

Attributes

MapObjectAcronym

Acronym="Acronym"

Acronym is mandatory.

UpdateObject

Acronym="Acronym"

Create="True"

MatchBy="attribute,attribute,attribute"

Acronym is mandatory

Create indicates that the object should be created if it does not yet exist. Default is Create=True.

MatchBy compares attribute values in the destination feature to values in the feature being imported. If the values match, the feature is updated. The attributes to be matched are in a comma-separated list. For example:

<UpdateObject Acronym="LightSectored" Create="True" MatchBy="fixedDateRange,marksNavigationalSystemOf,exhibitionConditionOfLight,height">

ConvertGeometry

Primitve="Feature Type"

Value="text"

Acronym="attribute"

Primitive is the geometry type to which the feature is being converted (area, line, point or text)

Value is the text string that is displayed in the chart (for conversion to text features only)

Acronym is the attribute that contains the text string for the text feature (for conversion to text features only).

Geometry mapping is supported only by the Import Selected Objects command. See Geometry Mapping

SetAttributeValue

Acronym="Acronym"

Value="Value"

Append="True/False"

Separator="Separator"

Acronym is mandatory.

Value is mandatory.

Append is used to indicate if the value should be appended to an existing value. This lets attribute values be constructed from multiple sources. If not defined, append=False.

Separator is used in conjunction with Append. The separator is added between attribute values that are being concatenated. If not defined, a comma is the default for list-type attributes and a space for text-type attributes. If no separator is used, then the value is set to Separator="None".

AssignCurrentDateToAttribute

Acronym="Acronym"

AdjustDayBy="Value"

Acronym is mandatory.

AdjustDayBy is used to add or subtract days from the current date. If value = 0 or if AdjustDayBy is not used, the current date will be used.

CopyAttributeValue

FromAcronym="acronym"

ToAcronym="acronym"

RelatedFeature="RelationCode/RoleCode/FeatureCode"

Round="Round/Truncate"

Precision="number of decimal places"

Append="True/False"

Separator="Separator"

Negate=”True/False”

Add="amount to add to value"

Minus="amount to subtract from value"

Multiply="amount by which to multiply value"

Divide="amount by which to divide value"

FromAcronym is mandatory.

ToAcronym is mandatory.

RelatedFeature copies the a value from a related S-100 feature to an S-57 feature. RelatedFeature consists of three components:

RelationCode: Type of feature relationship. For S-57 it can be annotation, collection, or master/slave. S-100 codes are defined in the catalogue.

RoleCode: The relationship link. For S-57 the Roles are:

Master/Slave: isAMasterOf, isASlaveOF

collection: consistsof, isAComponentOf

annotation: isAnnotatedBy, annotates

FeatureCode: The feature that is part of the relationship link

For non-S-100 mappings, the following relations and roles will be used:

masterSlave:

Relation name = master slave

Parent role code = isAMasterOf

Parent role name = is a master of

Child role code = isASlaveOf

Child role name = is a slave of

collection:

Relation name = collection

Parent role code = consistsOf

Parent role name = consists of

Child role code = isAComponentOf

Child role name = is a component of

annotation:

Relation name = annotation association

Parent role code = isAnnotatedBy

Parent role name = is annotated by

Child role code = annotates

Child role name = annotates

For example:

<CopyAttributeValue RelatedFeature="BridgeAggregation/consistsOf/Bridge" FromAcronym="featureName/name" ToAcronym="OBJNAM" Append="True"/>

If an S-100 BridgeAggregation consists of a Bridge feature, then copy that acronym to the OBJNAM attribute of an S-57 feature.

Round applies to conversions to integer or floating point numbers. If it is not specified, Round is assumed.

Precision determines the number of decimal places for conversions to floating point numbers. It is used with Round to convert the values.

Negate multiplies the floating point or integer number by –1 to negate. If it is not specified then Negate=False. Negate is used when converting S-57 soundings into VPF soundings, for example.

Add, Minus, Multiply and Divide use mathematical operators to change a numeric value to a new one:

Add="10.0" adds 10 to the attribute value.

Minus="10.0" subtracts 10 from the value.

Multiply="10.0" multiply the value by 10

Divide="10.0" divides the value by 10

The operator can use the value of an attribute instead of a numeric value. For example:

<CopyAttributeValue Attribute="HEIGHT" Minus="DRVAL1"/>

CopyConvertibleAttributes

All matching attributes in the first feature are copied to the second feature.

ApplyAttributeMapping

Name="AttributeMappingName"

Name is mandatory.

SetSpatialAttributeValue

Acronym="acronym

Value="value"

Append="True/False"

Separator="Separator"

Acronym is the acronym of the spatial attribute

Value is the numeric value of the attribute

Append is used to indicate if the value should be appended to an existing value. This lets attribute values be constructed from multiple sources. If not defined, append=False.

Separator is used in conjunction with Append. The separator is added between attribute values that are being concatenated. If not defined, a comma is the default for list-type attributes and a space for text-type attributes. If no separator is used, then the value is set to Separator="None".

CopyZValue

One of:

Precision="value"

ApplySoundingRounding="rule"

Precision is the number of decimal places to truncate the Z-value to.

ApplySoundingRounding applies a sounding rounding rule to a sounding or a depth attribute. The rule must be in SoundingRounding.xml.

AssignZValueToAttribute

Acronym="acronym"

Negate="True/False"

PositiveValuesOnly="True/false"

ApplySoundingRounding=”rule”

Add="amount to add to value"

Minus="amount to subtract from value"

Multiply="amount by which to multiply value"

Divide="amount by which to divide value"

Acronym is mandatory.

Negate multiplies the floating point or integer number by –1 to negate. If not specified, Negate=False. Negate is used when converting S-57 soundings to VPF soundings, for example.

PositiveValuesOnly means only positive floating point or integer attributes are converted. If not specified, PositiveValuesOnly=False. This is used when converting S-57 soundings to VPF soundings, for example.

ApplySoundingRounding applies a sounding rounding rule to a sounding or a depth attribute. The rule must be in SoundingRounding.xml.

Add, Minus, Multiply and Divide use mathematical operators to change a numeric value to a new one:

Add="10.0" adds 10 to the attribute value.

Minus="10.0" subtracts 10 from the value.

Multiply="10.0" multiply the value by 10

Divide="10.0" divides the value by 10

The operator can use the value of an attribute instead of a numeric value. For example:

<AssignZValueToAttribute Attribute="HEIGHT" Minus="DRVAL1"/>

MapAttribute

Name="Name of attribute mapping"

RepeatForEach="Attribute with more than one encoded value"

Name is mandatory.

RepeatForEach applies mapping to an attribute with a multiplicity of values.

The MapAttribute tag must contain one or more Entry tags. Each entry tag is made up of zero or one <Filter> tags and one or more attribute mapping tags.

SetAttributeValueUnknown

Acronym="Acronym"

This is available for all feature types.

Acronym is mandatory.

SetAttributeValueUndefined

Acronym="Acronym"

If the attribute exists in the object being mapped, it will be set to undefined in the new object.

SetScaminAttribute

Acronym =acronym"

ScaleFactor=Value

CSCLMultiplier="Value that overrides the divisor"

Acronym is optional.

ScaleFactor is mandatory. Value must be greater than 0.

For more information on the use of CSCLMultiplier, see Soundings and Non-Sounding Features.

AssignScaminByStep

Acronym ="Acronym"

Steps = "Value"

Acronym is optional.

Steps is mandatory

AssignScaminFromMaster

The feature is assigned the SCAMIN value of the master. This is only applicable to slave features.

AssignScaminFromParent

Acronym="Acronym"

Relationship="Relationship code"

Acronym is mandatory so that this function will work with any data type. This is the acronym of the attribute that represents the scale minimum value.

Relationship is mandatory since features can be in more than one type of relationship in S-101 datasets. Relationship codes are defined in the S-101 catalogue.

The relationship code for S-57 objects is masterSlave.

The feature is assigned the scale minimum value of the parent. This is only applicable to child features.

CreateCollectionFeature

Acronym="Acronym of the collection being created"

ToAcronym="Attribute on the new collection feature that receives the value”

Value="Attribute value"

All the attributes are mandatory

CreateCollectionFeatureFromAttribute

Acronym="Collection Feature"

FromAcronym="Attribute on the original feature to retrieve value from”

ToAcronym="Attribute on the new collection feature that receives the value"

All the attributes are mandatory.

Both this mapping rule and CreateCollectionFeature can be combined with filters. See the example below.

Example:

<CreateCollectionFeatureFromAttribute Acronym="Bridge" FromAcronym="OBJNAM" ToAcronym="featureName/name" >

  <Filter>

    <Not>

      <GeometryIsDisjoint>

        <Filter>

          <Or>

            <ObjectAcronymIsEqualTo Acronym="PylonBridgeSupport"/>

            <ObjectAcronymIsEqualTo Acronym="SpanFixed"/>

            <ObjectAcronymIsEqualTo Acronym="SpanOpening"/>

          </Or>

        </Filter>

      </GeometryIsDisjoint>

    </Not>

  </Filter>

</CreateCollectionFeatureFromAttribute>

A new Bridge collection object can contain any of the following features:

SpanFixed

PylonBridgeSupport

SpanOpening

that are not disjointed with the initial SpanFixed feature that was mapped from an S-57 BRIDGE feature.

Collections will be combined with other identical collections unless a filter is used, then they must also share a component.

ApplyEdgeMasking

Masked edge segments in the source will be marked as masked in the mapped data.

AssignAngleToAttribute

Acronym="Attribute Acronym to assign angle to"

The angle of the source symbol will be assigned to the specified attribute.

AssignFOIDValueToAttribute

Acronym="Attribute Acronym to assign FOID to"

 

The Feature Object ID (FOID) is assigned to an alphanumeric attribute.

DoNotMapObject

--

Skip this feature during mapping. See DoNotMapObject for an example of use.

OutputMessage

Value="Message to Display"

Display a plain text message to the user in the Mapping Output.

ReplaceAttributeValue

FromAcronym="Attribute Acronym on the source map whose value will be substituted"

ToAcronym="Attribute acronym on the destination map that will hold the updated value"

RegexPattern="The perl-style regular expression pattern"

ReplaceWith="The perl-style replace format"

Attribute text substitutions can be made using Regular Expressions (Regex). See Regular Expressions for more information.

SetRelationshipCode

Value="Relationship code to set"

Set the relationship code when mapping collections.

Multiple relationship codes can be set. When the collections are created, any invalid relationships are not created.

Example:

<Object Acronym="C_AGGR">

  <Filter>

     <FeatureHasComponent>

      <Filter>

        <ObjectAcronymIsEqualTo Acronym="FAIRWY"/>

      </Filter>

    </FeatureHasComponent>

  </Filter>

   <MapObject>

    <MapObjectAcronym Acronym="FairwaySystem"/>

    <SetRelationshipCode Value="FairwayAggregation"/>

    <OutputMessage Value="Note: S-57 Fairway C_AGGR (Aggregation) Collection feature converted to S-101 Fairway Aggregation."/>

  </MapObject>

</Object>

UpdateEdgeReference

Flag="Spatial Flag to be set"

Applies a flag to the edges of the matching feature based on a sub filter.

The filter rule must return a list of edges. The filter will be applied to the destination feature(s), after all the other mapping rules have applied.

Flag has three allowable values :

Masked: Edge will be flagged as Masked. Closed will be false.

Truncated: Edge will be flagged as Closed (Truncated). Masked will be false.

None: Edge will have neither a Masked or Closed flag. It will remove any existing flags.

Example:

<Object Acronym="CANALS">

<MapObject>

  <MapObjectAcronym Acronym="CANALS"/>

    <UpdateEdgeReference Flag="Masked">

      <Filter>

        <GeometrySharesSpatial ReportSharedSpatials="True">

            <Filter>

                <ObjectAcronymIsEqualTo Acronym="LNDARE" />

            </Filter>

        </GeometrySharesSpatial>

      </Filter>

    </UpdateEdgeReference>

    <UpdateEdgeReference Flag="Truncated">

      <Filter>

        <GeometrySharesSpatial ReportSharedSpatials="True">

          <Filter>

            <ObjectAcronymIsEqualTo Acronym="M_COVR" />

          </Filter>

        </GeometrySharesSpatial>

      </Filter>

    </UpdateEdgeReference>

</MapObject>

</Object>

This example will map all CANALS features to a CANALS feature.

Every edge of a CANALS feature that shares a spatial with a LNDARE will be flagged as "Masked". All other edges will be untouched.

In Addition, every edge that is shared with an M_COVR will be marked as Truncated ("Closed").

Rules are applied in the order encountered, so an edge used by both a LNDARE and an M_COVR will be marked as Truncated ("Closed"). There is no way to set both Closed AND Masked flags at the same time.

ExecuteAttributeScript

Script="Script to execute"

Specifies a pre-defined attribute scripts to assign values to attributes.

Currently two scripts are available for use with ENC to DNC mapping:

assign_natsur - Uses the NATSUR attribute to populate DNC ’nature of surface’ attributes.

assign_natqua - Uses the NATQUA attribute to populate DNC ’quality of surface’ attributes.