Feature attributes in an S-57 or HOB file can be inserted as annotations on a source usage. This is done using the CARIS Batch AddFeaturesAsAnnotations process. For more information on AddFeaturesAsAnnotations, see the CARIS Batch Guide.
The process reads feature identifiers from a HOB or S-57 file and adds annotations to matching features in an HPD usage. The annotations are generated from an annotation mapping file that sets what attributes can be used as annotations and how those annotations are displayed.
No annotation mapping files are in the release. All files must be built.
An example of a simple mapping file is shown below.
<?xml version="1.0" encoding="UTF-8" ?> <ObjectToObjectConversionTable Version="1.0" FromType="GO" ToType="GO"> <ConversionTableInfo Version="1.1" FromProduct="S-57" ToProduct="S-57 Name="Conversion For AddFeaturesAsAnnotations" CreationDate="20141210" CreatedBy="CARIS" Comment="File for AddFeaturesAsAnnotations."> </ConversionTableInfo> <ObjectMappings> <Object Acronym="LNDRGN"> <Filter> <PrimitiveIsEqualTo Primitive="Point"/> </Filter> <MapObject> <ConvertGeometry Primitive="Text" Acronym="OBJNAM"/> <MapObjectAcronym Acronym="$lndrg"/> <SetPropertyValue Property="text/style/font" Value="Courier"/> <SetPropertyValue Property="text/style/size" Value="25"/> <SetPropertyValue Property="text/style/bold" Value="True"/> <SetPropertyValue Property="text/style/italic" Value="False"/> <SetPropertyValue Property="text/position/hjust" Value="Left"/> <SetPropertyValue Property="text/position/vjust" Value="Above"/> <SetPropertyValue Property="text/position/rotationReference" Value="PoleNorth"/> </MapObject> </Object> </ObjectMappings> </ObjectToObjectConversionTable> |
In this example, the OBJNAM attribute for the point feature LNDRGN is converted to the $lndrg (land region name) cartographic feature. The $lndrg feature can be included as an annotation on LNDRGN features using the properties described in the file.
• The annotation is in 25 point, bold, Arial font.
• The horizontal justification is left.
• The vertical justification is above the feature.
• The rotation reference is PoleNorth which means that the annotation’s orientation is set to north according to the coordinate reference system.
Attributes can also be set on a feature and used as annotations. See the following example.
<?xml version="1.0" encoding="UTF-8" ?> <ObjectToObjectConversionTable Version="1.0" FromType="GO" ToType="GO"> <ConversionTableInfo Version="1.1" FromProduct="S-57" ToProduct="S-57" Name="Conversion For AddFeaturesAsAnnotations" CreationDate="20141210" CreatedBy="CARIS" Comment="File for AddFeaturesAsAnnotations."> </ConversionTableInfo> <GlobalAttributeMappings/> <AttributeMappings> <MapAttribute Name="SetVerticalTextPosition"> <Entry> <Filter> <AttributeValueContains Acronym="INFORM" Value="Top" /> </Filter> <SetPropertyValue Property="text/position/vjust" Value="Above" /> </Entry> <Entry> <Filter> <AttributeValueContains Acronym="INFORM" Value="Centre" /> </Filter> <SetPropertyValue Property="text/position/vjust" Value="Centre" /> </Entry> <Entry> <Filter> <AttributeValueContains Acronym="INFORM" Value="Bottom" /> </Filter> <SetPropertyValue Property="text/position/vjust" Value="Below" /> </Entry> </MapAttribute> <MapAttribute Name="SetHorizontalTextPosition" > <Entry> <Filter> <AttributeValueContains Acronym="INFORM" Value="Left" /> </Filter> <SetPropertyValue Property="text/position/hjust" Value="Left" /> </Entry> <Entry> <Filter> <AttributeValueContains Acronym="INFORM" Value="Centre" /> </Filter> <SetPropertyValue Property="text/position/hjust" Value="Centre" /> </Entry> <Entry> <Filter> <AttributeValueContains Acronym="INFORM" Value="Right" /> </Filter> <SetPropertyValue Property="text/position/hjust" Value="Right" /> </Entry> </MapAttribute> <MapAttribute Name="SetBold"> <Entry> <Filter> <AttributeHasValue Acronym="TXTDSC"/> </Filter> <CopyAttributeValue FromAcronym="TXTDSC" ToProperty="text/style/bold" /> </Entry> </MapAttribute>
|
<MapAttribute Name="SetTextOrientation"> <Entry> <Filter> <AttributeValueContains Acronym="$style" Value="Grid" /> </Filter> <SetPropertyValue Property="text/position/rotationReference" Value="GridNorth" /> </Entry> <Entry> <Filter> <AttributeValueContains Acronym="$style" Value="North" /> </Filter> <SetPropertyValue Property="text/position/rotationReference" Value="PoleNorth"/> </Entry> <Entry> <Filter> <AttributeValueContains Acronym="$style" Value="South" /> </Filter> <SetPropertyValue Property="text/position/rotationReference" Value="PoleSouth" /> </Entry> </MapAttribute> </AttributeMappings> <ObjectMappings> <Object Acronym="LNDRGN"> <Filter> <PrimitiveIsEqualTo Primitive="Point"/> </Filter> <MapObject> <ConvertGeometry Primitive="Text" Acronym="OBJNAM"/> <MapObjectAcronym Acronym="$lndrg"/> <ApplyAttributeMapping Name="SetBold" /> <ApplyAttributeMapping Name="SetVerticalTextPosition"/> <ApplyAttributeMapping Name="SetHorizontalTextPosition"/> </MapObject </ObjectMappings> </ObjectToObjectConversionTable> |
In this example, the OBJNAM attribute for the point feature LNDRGN is converted to $lndrg (land region name) cartographic feature. The $lndrg feature can be included as an annotation on LNDRGN features using the properties set through attributes.
For example, if the INFORM attribute contains the value Left and the TXTDSC contains a value. The horizontal justification property of the annotation (text/position/hjust) is set to left and value in TXTDSC is included with the annotation in bold text.
If a property is not set then the following defaults are used.
Property | Default Value |
|---|---|
Font | Lucidia Console |
Text Size | 28 point (corresponds to 10mm on screen) |
Bold | False |
Italic | False |
Horizontal Justification | Left |
Vertical Justification | Baseline |
Rotation Reference | Grid North |
The following table describes the mapping functions that are required for mapping features and attributes as annotations.
Mapping Function | Attribute | Attribute Value |
|---|---|---|
|
| This must be set to Note that the following mapping functions cannot be applied until this function is set. |
|
| The attribute value from where the text is be copied. |
| Paths determine text formatting, The following path values can be applied: • text/style/font - A text string with a name of the font. • text/style/size - A positive non-zero double value with the text size in points. • text/style/bold - "True" or "False" indicating if text should be bolded. • text/style/italic - "True" or "False" indicating if text should be italicized. • text/position/hjust - A text string indicating how the text is positioned horizontally. Valid hjust values are: • Left • Centre • Right • text/position/vjust - A text string indicating how the text is positioned vertically. Valid vjust values are: • Baseline • Font Upper • Font Lower • Above • Below • Centre | |
|
| Paths determine text formatting, The following path values can be applied: • text/style/font - A text string with a name of the font. • text/style/size - A positive non-zero double value with the text size in points. • text/style/bold - "True" or "False" indicating if text should be bolded. • text/style/italic - "True" or "False" indicating if text should be italicized. • text/position/hjust - A text string indicating how the text is positioned horizontally. Valid hjust values are: • Left • Centre • Right • text/position/vjust - A text string indicating how the text is positioned vertically. Valid vjust values are: • Baseline • Font Upper • Font Lower • Above • Below • Centre • text/position/rotationReference - A text string indicating the position of text in relation to the projection. There are three positions: • GridNorth • PoleNorth • PoleSouth |
|
| The
An The |
Example for text:
Example for Symbol Annotation : <
| ||