CARIS HPD : HPD® Server API : Vector Product Data : P_VECTORAPI : ADDS57DEFINITION
 

ADDS57DEFINITION

Add an S-57 product definition. This may be a new product or a new edition of an existing product.

The default location for the product information XML files is C:\Program Files\CARIS\HPD\<version>\Modules\support\Compilation2\ProductInfoFiles. For more information, see Product Information File.

Input

Parameter

Type

Description

v_productInfoId

VARCHAR2

This matches the id field of the product XML tag in the S-57 productinfo files. See notes below.

v_productInfoVersion

VARCHAR2

This matches the version field of the product XML tag in s57productinfo.xml. See notes below.

v_productInfoKey

VARCHAR2

This matches the key field of the product XML tag in s57productinfo.xml. See notes below.

v_name

VARCHAR2

The product name. If a product with this name already exists, a new edition of that product is created.

v_attfle

NUMBER

ATTF lexical level.

v_natfle

NUMBER

NATF lexical level.

v_hordat

NUMBER

Horizontal datum.

v_sdatum

NUMBER

Sounding datum.

v_verdat

NUMBER

Vertical datum.

v_hunits

NUMBER

Height/length units.

v_dunits

NUMBER

Depth units.

v_punits

NUMBER

Positional accuracy units.

v_navpur

NUMBER

Navigational purpose.

v_prcode

VARCHAR2

The binary code for producer.

v_edinum

NUMBER

Product edition number.

v_updnum

VARCHAR2

Product update number.

v_compsc

NUMBER

Compilation scale of data.

v_datset

VARCHAR2

Data set file name.

v_commen

VARCHAR2

Product comments.

v_dspcmt

VARCHAR2

Comment field for Data Set Parameter Field Structure.

v_isudat

DATE

Product issued date.

v_geom

SDO_GEOMETRY

Coverage area. This must be a rectangle with no inner rings. This is snapped to 1e-7. For more information, see Oracle Geometries.

v_profile

NUMBER

ID of the profile.

v_productgroup

VARCHAR2

Name of a product group. The product is assigned to this product group. This defaults to NULL, which is valid if access control is not being used.

v_somf

NUMBER

Sounding multiplication factor of the S- 57 product.

Output

Type

Description

INTEGER

The "product version id" of the newly created S-57 product. The "product id" can be obtained via the view VECTOR_PRODUCT_VIEW

Notes on the s57productinfo.xml triplet

If creating generic S-57 products, you must associate a profile with the "Generic S-57" product using the "associate profiles" command in "Catalogue Editor" before using this API. Then, use the key "GENERIC" and the id and version from the S-57 product information file. The following ids/keys are also supported.

ENC/ENC

CLB/AML

ESB/AML

LBO/AML

MFF/AML

RAL/AML

SBO/AML

USACE_IENC/IENC

IENC BRAZIL/IENC

US IENC/IENC

IENC Overlay

BRAZIL/IENC_OVERLAY

US IENC Overlay/IENC_OVERLAY

PNM/ENC

AIO Intermediate/ENC

IENC/IENC

IENC Overlay/IENC_OVERLAY

Example

Two geometries are used when creating S-57 products. The product geometry defines the limits of the S-57 product. Holes are prohibited from this geometry and it must be rectangular. The second geometry defines the extent of source extraction and may contain holes and/or be non- rectangular.

The source extraction geometry is synonymous with the “Data Cover Areas” when creating S-57 products with complex layout, using the HPD Product Editor application. The source extraction geometry may be the same as the geometry of the product boundary, but cannot extend beyond the product boundary.

-- This creates an ENC without holes.

set serveroutput on size 1000000;

DECLARE

  -- S57 Product Parameters and Attributes.

  v_NAME            VARCHAR2(255)     := 'API Example Without Holes';

  -- ATTF Lexical Level

  -- To obtain a list of valid ATTF Lexical Levels, run the following SQL query:

  -- select value, description from lexicallevel_vw where acronym = 'ATTFLE';

  v_ATTFLE          NUMBER            := 1;

  -- NATF Lexical Level

  -- To obtain a list of valid NATF Lexical Levels, run the following SQL query:

  -- select value, description from lexicallevel_vw where acronym = 'NATFLE';

  v_NATFLE          NUMBER            := 2;

  -- Look at HPD Dictionary Editor or look at

  -- S-57 ENC Object Catalogue and Attribute Catalogue (in the appendix).

  -- Or, for an easier way, click the Help menu item in ENC Editor. In the

  -- resultant HTML page, browse the values for the following attributes:

  -- D for DUNITS

  -- H for HUNITS

  -- V for VERDAT

  -- P for PUNITS

  v_HORDAT          NUMBER             := 2;  -- By looking for attribute HORDAT, 2 = WGS 84

  v_SDATUM          NUMBER             := 3;  -- Use the same value as the attribute VERDAT

  v_VERDAT          NUMBER             := 3;  -- by looking for attribute VERDAT

  v_HUNITS          NUMBER             := 1;  -- by looking for attribute HUNITS

  v_DUNITS          NUMBER             := 1;  -- by looking for attribute DUNITS

  v_PUNITS          NUMBER             := 1;  -- by looking for attribute PUNITS

  -- Refer to the NAVPUR value in Section 2.1 of

  -- the ISO S-57 Appendix B: Product Specifications document

  v_NAVPUR          NUMBER             := 2;

  v_EDINUM          VARCHAR2(1)        := '2';

  v_PRCODE          VARCHAR2(5)        := '1C';

  v_UPDNUM          VARCHAR2(3)        := '1.0';

  -- v_DATSET must contain the producer code (v_PRCODE), the navigational

  -- purpose (v_NAVPUR) and 5 character individual cell code.

  -- Reference: Section 5.6.3 of IHO S-57 Appendix B: Product Specifications

  v_DATSET          VARCHAR2(22)        := '1C212345';

  v_CMMNTS          VARCHAR2(255)       := 'This is an API created ENC Product.';

  v_DSPCMT          VARCHAR2(255)       := 'Comment For Data Set Parameter Field Structure';

  v_COMPSC          NUMBER              := 10000;

  v_ISUDAT          DATE                := SYSDATE;

  v_PRODUCTGEOM     SDO_GEOMETRY        := NULL;

  v_SRCEXTGEOM      SDO_GEOMETRY        := NULL;

  v_PROFILE         NUMBER(38)          := 6; -- 'S-57 ENC' value from the OBJECT_PROFILE table

  v_PRODUCTGROUP    VARCHAR2(100)       := NULL; -- Use the default Product Group

  -- Source Extraction Parameters.

  -- Name of the usage, which can be obtained from the USAGES view.

  -- This is also displayed in the usage layers in the editor.

  v_usage_name  VARCHAR2(800)           := 'Harbour(4000-21999)';

  v_product_id  NUMBER;

  v_productversion_id NUMBER;

BEGIN

  -- Geometry for product boundary. Holes are not supported in the product extent.

  -- This must be a rectangle.

  v_PRODUCTGEOM := SDO_GEOMETRY(2003,

    p_schema_constants.default_source_geom_srid,

    NULL,

    sdo_elem_info_array (1, 1003, 3),

    sdo_ordinate_array (-72.558333300, 46.320000000,

                              -72.488333300, 46.373333300));

  --Create the new product

  v_productversion_id := P_VECTORAPI.ADDS57DEFINITION(

    'ENC', '3.1', 'ENC', v_NAME, v_ATTFLE, v_NATFLE, v_HORDAT,

    v_SDATUM, v_VERDAT, v_HUNITS, v_DUNITS,

    v_PUNITS, v_NAVPUR, v_PRCODE, v_EDINUM, v_UPDNUM, v_COMPSC, v_DATSET,

    v_CMMNTS, v_DSPCMT, v_ISUDAT, v_PRODUCTGEOM, v_PROFILE, v_PRODUCTGROUP);

  select product_id into v_product_id

  from VECTOR_PRODUCT_VIEW

  where productversion_id = v_productversion_id;

/* This geometry defines the source extraction boundary. Holes are supported.

     Source extraction geometry may be the same as

     the Product geometry, but cannot extend beyond the product boundary.

     Example source extraction geometry with a hole:

      v_SRCEXTGEOM := SDO_GEOMETRY(2003,

        p_schema_constants.default_source_geom_srid,

        NULL,

        sdo_elem_info_array (1, 1003, 1, 11, 2003, 3),

        sdo_ordinate_array (

                -72.558333300, 46.320000000,

                -72.488333300, 46.320000000,

                -72.488333300, 46.373333300,

                -72.558333300, 46.373333300,

                -72.558333300, 46.320000000,

                -72.532887600, 46.341853100,

                -72.510709200, 46.355087300) );

  */

  -- The source extraction geometry may be the same as the product extent.

  v_SRCEXTGEOM := v_PRODUCTGEOM;

  -- Add a source usage to the product.

  P_VECTORAPI.ADD_SOURCE_USAGE(v_product_id, v_usage_name);

  -- Add Source Extraction.

  P_VECTORAPI.ADD_SOURCE_EXTRACTION(v_product_id, v_SRCEXTGEOM);

  -- Display the ID for the newly created ENC Product

  DBMS_OUTPUT.PUT_LINE('--*-- Created S57 Product Version ID: ' || v_productversion_id);

END;

/

Exceptions

Could not find the 'S57PRO' object in the catalogue.

Product Info Id ’%id%’ is not a valid value.

Product Info Id '%id%' is not a valid value for Key '%key%'.

Vector product '%name%' edition %edition% already exists in HPD.

Profile name '%id%' is invalid or does not currently exist.

Edition Number '%value%' is invalid. This value must be a whole number greater than 0.