CARIS HIPS and SIPS : Support Files : Filters : Internal Functions
 

Internal Functions

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.

CheckColourPattern

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>

CheckSIGGRPFormat

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 SIGREP 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>

CheckSIGGRPBrackets

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>

CheckSIGSEQFormat

Description

Check if SIGEQ values conform to the S-58 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-58 Test 557.

<Filter>

  <Not>

    <Function Name="CheckSIGSEQFormat"/>

  </Not>

</Filter>

CheckSIGSEQ_SIGPER_Intervals

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 intervals of eclipse for 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 in light and eclipse given in SIGSEQ.

<Filter>

  <Not>

    <Function Name="CheckSIGSEQ_SIGPER_Intervals"/>

  </Not>

</Filter>

CheckTS_TSPFormat_TideStreamOrientations

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>

CheckTS_TSPFormat_TideStreamRates

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>

CheckDateFormat

Description

Check if attributes DATEND, DATSTA, PEREND, PERSTA, SORDAT, CPDATE, SUREND or SURSTA formats conform to ISO 8601:1988.

Valid formats are CCMMDD, CCYYMM, CCYY, MMDD, MM.

Parameters

Parameter tags with one or more AttributeAcronym parameters.

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>

CheckDateTimeFormat

Description

Check if formats for TIMSTA and TIMEND values are correct.

Valid date/time format is CCYYMMDDThhmmss

Parameters

Parameter tags with one or more AttributeAcronym parameters.

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>

CheckSBDARE_NATSUR_NATQUA

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>

CheckNATSUR_NATQUA_Relationship

Description

Check that NATSUR is encoded and the associated value for NATQUA (if encoded) is correct according to the table for Test 1760 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 1760.

<Filter>

  <Not>

    <Function Name="CheckNATSUR_NATQUA_Relationship"/>

  </Not>

</Filter>

CheckExternalFileExists

Description

Check if the given attributes reference existing external files.

Parameters

Parameter tags with one or more AttributeAcronym parameters.

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>

CheckExternalFileIsEmpty

Description

Check if any of the files referenced by the given attributes are empty.

Parameters

Parameter tags with one or more AttributeAcronym parameters.

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>

CheckExternalFileFormat

Description

Checks if attributes PICREP, TXTDSC and NTXTDS contain only one file and checks for invalid semi-colons (;) in the file name.

Parameter

Parameter tags with one or more AttributeAcronym parameters.

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>

CheckExternalFileFormat_Spacing

Description

Check if the given external file attributes do not begin or end with a space.

Parameter

Parameter tags with one or more AttributeAcronym parameters.

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>

CheckMORFAC_i1508

Description

Check if MORFAC point features are shared with a point SEAARE feature or no SEAARE feature. Note that this function only works for point MORFAC and SEAARE objects.

Parameter

Example

Find MORFAC features that shared with more than one SEAARE point features.

<Filter>

  <And>

    <PrimitiveIsEqualTo Primitive="Point"/>

      <Not>

        <Function Name="CheckMORFAC_i1508"/>

     </Not>

  </And>

</Filter>

CheckSectorLightAngle

Description

Check that no LIGHTS object has CATLIT=1 [directional function] with the angle defined by SECTR1 and SECTR2 being greater than 10º.

If CATLIT, SECTR1 or SECTR2 are set to UNDFINED or UNKNOWN, the test is passed.

Parameter

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>

CheckTextualAttributesC0chars

Description

Check if text attribute values use invalid C0 characters. Non-printable characters have ASCII decimal values of 0 to 31 or 127. ASCII characters between 32 and 127 inclusive are printable.

Parameter

Example

Find printable attribute characters.

<Filter>

  <Not>

    <Function Name="CheckTextualAttributesC0chars"/>

  </Not>

</Filter>

CheckTSELNE_1686

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.

Parameter

Example

Fine 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>

CheckTSEZNE_1687

Description

Test 1687 function to check if a TSEZNE object separates either

two traffic lanes

traffic lane and inshore traffic zone

centre of a roundabout

The test will pass if at least one edge of the TSEZNE 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)

Parameter

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>

CheckTSSCRS_1688

Description

Test 1688 function to check if any TSSCRS object encodes a crossing between at least four traffic lanes.

The test will pass if the edges of the TSSCRS feature is shared with at least four separate TSSLPT features.

Parameter

Example

Find TSSCRS features that do not touch more than three TSSLPT or TWRTPT features.

<Filter>

  <Not>

    <Function Name="CheckTSSCRS_1688"/>

  </Not>

</Filter>

CheckTSSBND_1685a

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>

CheckTSSBND_1685b

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>

TSSLPT_IsAJunction

Description

Check if the TSSLPT feature forms a junction between three or more other TSSLPT features with different ORIENT attribute values.

Parameter

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>

Depth_DredgedAreaContainsSounding

Description

Check if depth or dredged areas contain one or more soundings. Grouped soundings are taken into account by examining each sounding spatial.

Parameter

Example

Find DEGARE or DRGARE features without soundings.

<Filter>

  <And>

    <PrimitiveIsEqualTo Primitive="Area" />

      <Not>

        <Function Name="Depth_DredgedAreaContainsSounding" />

      </Not>

  </And>

</Filter>

IsSoundingInDepth_DredgedArea

Description

Check if selected soundings fall within a depth or dredged area. Grouped soundings are taken into account by examining each sounding spatial.

Parameter

Example

Find soundings that are not inside a DEPARE or DRGARE feature.

<Filter>

  <Not>

    <Function Name="IsSoundingInDepth_DredgedArea" />

  </Not>

</Filter>