The Geometry_Mapping_Examples.xml file uses the <ConvertGeometry/> function to map geometry for individual features. These conversion options are available:
• Area-to-point (position is calculated from centre of area)
• Area-to-edge (uses the area boundary lines)
• Area-to-text (position is calculated from centre of area)
• Sounding-to-point
• Text-to-point
• Point-to-text.
This is an example of geometry conversion from a land area feature to a coastline feature.
<Object Acronym="LNDARE"> <Filter> <PrimitiveIsEqualTo Primitive="Area" /> </Filter> <MapObject> <MapObjectAcronym Acronym="COALNE"/> <ConvertGeometry Primitive="Line"/> <OutputMessage Value="Area-to-Line Geometry Mapping Example." /> <CopyConvertibleAttributes/> </MapObject> </Object> |
The land area (LNDARE) feature is converted to a coastline feature using <ConvertGeometry/> to change the feature from an area to a line.
This example creates a text feature from an area feature in a VPF file.
<Object Acronym="AL020_area"> <Filter> <PrimitiveIsEqualTo Primitive="Area"/> </Filter> <MapObject> <ConvertGeometry Primitive="Text" Value="Area to Text"/> <MapObjectAcronym Acronym="ZD040"/> <CopyConvertibleAttributes /> </MapObject> </Object> |
The area feature is converted using <ConvertGeometry/>. The text to be displayed is set through the Value attribute. In this example, the text is Area to Text.
An attribute value can also be used for text content:
<Object Acronym="AL020_point"> <Filter> <PrimitiveIsEqualTo Primitive="Point"/> </Filter> <MapObject> <ConvertGeometry Primitive="Text" Acronym="NAM"/> <MapObjectAcronym Acronym="ZD040"/> <CopyConvertibleAttributes /> </MapObject> </Object> |
A point feature is converted to a ZD040 text feature. The text is read from the NAM attribute and is displayed in the chart.