Filters can also evaluate data by calling internal functions from the application. Functions are enclosed within <Function/> tags and return a true or false value when run. The tag includes a Name attribute that identifies the function. See example below.
<Filter> <Not> <Function Name="CheckTextualAttributesC0chars"/> </Not> </Filter> |
In this example, those features with attributes that did not meet the criteria set by the function are returned.
Some internal functions require a <Parameter/> tag. This tag includes Name and Value attributes. Name defines the parameter that the function evaluates (currently, this is only AttributeAcronym) and Value defines the specific parameter. See example below.
<Filter> <Not> <Function Name="CheckDateFormat"> <Parameters> <Parameter Name="AttributeAcronym" Value="DATEND"/> <Parameter Name="AttributeAcronym" Value="DATSTA"/> <Parameter Name="AttributeAcronym" Value="PEREND"/> <Parameter Name="AttributeAcronym" Value="PERSTA"/> </Parameters> </Function> </Not> </Filter> |
The following table lists the available internal functions with a description and example for each one.
| |
Description | Checks if the COLPAT attribute is encoded for every object with more than one COLOUR (except LIGHTS); or, checks for no COLPAT value for objects with only one COLOUR. |
Parameters | — |
Example | Find features where the COLPAT attribute is available and COLOUR has only one value. |
<Filter> <Not> <Function Name="CheckColourPattern"/> </Not> </Filter> | |
| |
Description | Check if the SIGGRP attribute format is correct for all lights (except fixed lights). The function does not check brackets and will skip values set to UNDEFINED or UNKNOWN. |
Parameters | — |
Example | Find LIGHTS features where the SIGGREP format is not correct. |
<Filter> <Or> <And> <AttributeValueIsEqualTo Acronym="LITCHR" Value="1"/> <AttributeHasValue Acronym="SIGGRP"/> </And> <And> <AttributeValueIsNotEqualTo Acronym="LITCHR" Value="1"/> <Not> <Function Name="CheckSIGGRPFormat"/> </Not> </And> </Or> </Filter> | |
| |
Description | Check if SIGGRP attribute values starts and finishes with a bracket (). |
Parameters | — |
Example | Find features with SIGGRP attribute values that do not begin or end with brackets. |
<Filter> <Not> <Function Name="CheckSIGGRPBrackets"/> </Not> </Filter> | |
| |
Description | Check if SIGSEQ values conform to the S-57 specification for string formatting. Values set to UNDEFINED or UNKNOWN are passed. |
Parameters | — |
Example | Find features that contain SIGSEQ attribute values that are not formatted according to S-57 (S-58 Test 557). |
<Filter> <Not> <Function Name="CheckSIGSEQFormat"/> </Not> </Filter> | |
| |
Description | Check if both SIGSEQ and SIGPER attributes are encoded then the SIGPER value must be equal to the sum of both intervals of light and eclipse in SIGSEQ. SIGSEQ or SIGPER values (or both) set to UNDEFINED or UNKNOWN are passed. |
Parameters | — |
Example | Find features where SIGSEQ is not null and SIGPER is not equal to sum of intervals of light and eclipse given in SIGSEQ. |
<Filter> <Not> <Function Name="CheckSIGSEQ_SIGPER_Intervals"/> </Not> </Filter> | |
| |
Description | Check if TS_TSP attributes contains a tide stream orientation value between 000 and 360 degrees. |
Parameters | — |
Example | Find TS_PAD features with a TS_TSP tide stream orientation that is not between 000 and 360 degrees. |
<Filter> <Not> <Function Name="CheckTS_TSPFormat_TideStreamOrientations"/> </Not> </Filter> | |
| |
Description | Check if each TS_TSP contains a tide stream rate value between 0.0 and 20.0 |
Parameters | — |
Example | Find TS_PAD features with TS_TSP tide stream rate that is not between 0.0 and 20.0. |
<Filter> <Not> <Function Name="CheckTS_TSPFormat_TideStreamRates"/> </Not> </Filter> | |
| |
Description | Check if attributes DATEND, DATSTA, PEREND, PERSTA, SORDAT, CPDATE, SUREND or SURSTA formats conform to ISO 8601:1988. Valid formats are CCYYMMDD, CCYYMM, CCYY, MMDD, MM. |
Parameters | Parameter tags with one or more |
Example | Find DATEND, DATSTA, PEREND, or PERSTA attributes where the date is not formatted according to the ISO 8601:1988 standard. |
<Filter> <Not> <Function Name="CheckDateFormat"> <Parameters> <Parameter Name="AttributeAcronym" Value="DATEND"/> <Parameter Name="AttributeAcronym" Value="DATSTA"/> <Parameter Name="AttributeAcronym" Value="PEREND"/> <Parameter Name="AttributeAcronym" Value="PERSTA"/> </Parameters> </Function> </Not> </Filter> | |
| |
Description | Check if formats for TIMSTA and TIMEND values are correct. Valid date/time format is |
Parameters | Parameter tags with one or more |
Example | Find features that contain TIMEND and TIMSTA attributes with values that do not conform to S-57 date-time formatting. |
<Filter> <Not> <Function Name="CheckDateTimeFormat"> <Parameters> <Parameter Name="AttributeAcronym" Value="TIMEND"/> <Parameter Name="AttributeAcronym" Value="TIMSTA"/> </Parameters> </Function> </Not> </Filter> | |
| |
Description | Check the following formatting rules for attributes NATSUR and NATQUA: • each NATSUR value is separated by a slash or comma without a space • NATSUR does not begin or finish with a comma or space • NATSUR does not have more than one consecutive comma or space • NATSUR and NATQUA values have the same number of commas or slashes. NATSUR and NATQUA attributes that are set UNDEFINED or UNKNOW are passed. |
Parameters | — |
Example | Find SBDARE features where NATSUR and NATQUA attributes do not contain an equal number of delimiters. |
<Filter> <Not> <Function Name="CheckSBDARE_NATSUR_NATQUA"/> </Not> </Filter> | |
| |
Description | Check that NATSUR is encoded and the associated value for NATQUA (if encoded) is correct according to the table for Test 1780 in S-58 ENC Validation Checks. NATSUR and NATQUA attributes that are set UNDEFINED or UNKNOWN are passed. |
Parameters | — |
Example | Find SBDARE features where NATSUR and NATQUA combination of values are not in accordance with S-58 test 1780. |
<Filter> <Not> <Function Name="CheckNATSUR_NATQUA_Relationship"/> </Not> </Filter> | |
| |
Description | Check if the given attributes reference existing external files. |
Parameters | Parameter tags with one or more |
Example | Find TXTDSC attributes with a file that is not in the exchange set or does not conform to the ENC product specification. |
<Filter> <And> <AttributeHasValue Acronym="TXTDSC"/> <Or> <Not> <AttributeValueIsLike Acronym="TXTDSC" Value="[A-Z0-9]{2}[A-Z0-9_]{6}\.TXT" MatchCase="True"/> </Not> <Not> <Function Name="CheckExternalFileExists"> <Parameters> <Parameter Name="AttributeAcronym" Value="TXTDSC"/> </Parameters> </Function> </Not> </Or> </And> </Filter> | |
| |
Description | Check if any of the files referenced by the given attributes are empty. |
Parameters | Parameter tags with one or more |
Example | Find features with a TXTDSC attribute that contains an empty file. |
<Filter> <Function Name="CheckExternalFileIsEmpty"> <Parameters> <Parameter Name="AttributeAcronym" Value="TXTDSC"/> </Parameters> </Function> </Filter> | |
| |
Description | Check if attributes PICREP, TXTDSC and NTXTDS contain only one file, and checks for invalid semi-colons (;) in the file name. |
Parameters | Parameter tags with one or more |
Example | Find PICREP, TXTDSC or NTXTDS attributes with more than one file name. |
<Filter> <Not> <Function Name="CheckExternalFileFormat"> <Parameters> <Parameter Name="AttributeAcronym" Value="PICREP"/> <Parameter Name="AttributeAcronym" Value="TXTDSC"/> <Parameter Name="AttributeAcronym" Value="NTXTDS"/> </Parameters> </Function> </Not> </Filter> | |
| |
Description | Check if the given external file attributes do not begin or end with a space. |
Parameters | Parameter tags with one or more |
Example | Find external file attributes that contain leading or trailing spaces. |
<Filter> <Not> <Function Name="CheckExternalFileFormat_Spacing"> <Parameters> <Parameter Name="AttributeAcronym" Value="PICREP"/> <Parameter Name="AttributeAcronym" Value="TXTDSC"/> <Parameter Name="AttributeAcronym" Value="NTXTDS"/> </Parameters> </Function> </Not> </Filter> | |
| |
Description | Check if MORFAC point features that are shared with a point SEAARE feature or no SEAARE feature (IENC checks). Note that this function only works for point MORFAC and SEAARE objects. |
Parameters | – |
Example | Find MORFAC features that are shared with more than one SEAARE point features. |
<Filter> <And> <PrimitiveIsEqualTo Primitive="Point"/> <Not> <Function Name="CheckMORFAC_i1508"/> </Not> </And> </Filter> | |
| |
Description | Check that LIGHTS object has CATLIT=1 [directional function] or 16 [moiré effect] and the angle, defined by SECTR1 and SECTR2, is not greater than 10º. If CATLIT, SECTR1 or SECTR2 are set to UNDFINED or UNKNOWN, the test is passed. |
Parameters | – |
Example | Find LIGHTS where CATLIT=1 or CATLIT=16 with a sector arc that is greater than 10 degrees. |
<Filter> <Not> <Function Name="CheckSectorLightAngle"/> </Not> </Filter> | |
| |
Description | Check if text attribute values use invalid C0 characters. Non-printable characters have ASCII decimal values of 0 to 32 or 127. ASCII characters between 33 and 126 inclusive are printable. |
Parameters | – |
Example | Find printable attribute characters. |
<Filter> <Not> <Function Name="CheckTextualAttributesC0chars"/> </Not> </Filter> | |
| |
Description | Check for S-58 test 1686. This test will return true if each edge of the input feature is shared with either two TSSLPT features or one TSSLPT and one ISTZNE feature. |
Parameters | – |
Example | Find TSELNE features that do not share edges with • two TSSLPT features • a TSSLPT feature and an ISTZNE feature |
<Filter> <Not> <Function Name="CheckTSELNE_1686"/> </Not> </Filter> | |
| |
Description | Check for S-58 test 1687. The test will pass if at least one edge of the input feature is shared with either: • two or more TSSLPT features • one TSSLPT feature and one ITSZNE feature • a TSSRON feature’s inner ring edges (the ring must equal the island of a TSSRON feature) |
Parameters | – |
Example | Find TSEZNE features that do not share edges with • two or more TSSPLT features • one TSSLPT feature and one ISTZNE feature • one TSSRON feature |
<Filter> <Not> <Function Name="CheckTSEZNE_1687"/> </Not> </Filter> | |
| |
Description | Check for S-58 test 1688. The test will pass if the edges of the TSSCRS feature are shared with at least four separate TSSLPT or TWRTPT features. |
Parameters | – |
Example | Find TSSCRS features that do not touch more than three TSSLPT or TWRTPT features. |
<Filter> <Not> <Function Name="CheckTSSCRS_1688"/> </Not> </Filter> | |
| |
Description | Check if each edge of a TSSBND feature is shared with only one TSSRON or TSSLPT feature. |
Parameters | – |
Example | Find TSSBND features that do not share an edge with TSSRON or TSSLPT feature. |
<Filter> <Not> <Function Name="CheckTSSBND_1685a"/> </Not> </Filter> | |
| |
Description | Check if each edge of a TSSBND feature object that is shared with the limits of a TSEZNE feature, is also shared with one of the following features: • TSSRON • TSSPLT • ISTZNE |
Parameters | – |
Example | Find TSSBND features that share an edge with TSEZNE features but do not share the same edge with a TSSRON, TSSLPT or ISTZNE features. |
<Filter> <Not> <Function Name="CheckTSSBND_1685b"/> </Not> </Filter> | |
| |
Description | Check if the TSSLPT feature forms a junction between three or more other TSSLPT features with different ORIENT attribute values. |
Parameters | – |
Example | Find TSSLPT features that do not form a junction between three or more other TSSLPT features with different ORIENT attribute values. |
<Filter> <Not> <Function Name="TSSLPT_IsAJunction"/> </Not> </Filter> | |
| |
Description | Check if depth or dredged areas contain one or more soundings. Grouped soundings are taken into account by examining each sounding spatial. |
Parameters | – |
Example | Find DEPARE or DRGARE features without soundings. |
<Filter> <And> <PrimitiveIsEqualTo Primitive="Area" /> <Not> <Function Name="Depth_DredgedAreaContainsSounding" /> </Not> </And> </Filter> | |
| |
Description | Check if selected soundings fall within a depth or dredged area. Grouped soundings are taken into account by examining each sounding spatial. |
Parameters | – |
Example | Find soundings that are not inside a DEPARE or DRGARE feature. |
<Filter> <Not> <Function Name="IsSoundingInDepth_DredgedArea" /> </Not> </Filter> | |