CARIS HPD : HPD® Server API : Paper Product Data : P_PPRAPI : ADDPANEL
 

ADDPANEL

Add a panel to a paper chart sheet.

Input

Parameter

Type

Description

v_sheetver_id

NUMBER

ID of the "sheet version" to add this new panel to.

v_profile

NUMBER

ID of the profile to use for the panel.

v_geom_wgs84

SDO_GEOMETRY

This geometry defines the area of the panel in the WGS84 coordinate reference system. The first two points of this geometry also define the alignment line, which defines the panel rotation/orientation. The panel is rotated so that the alignment line is parallel to the bottom edge of the sheet. The alignment line is shifted on the sheet by PANPOS. This function snaps the geometry to 1e-7. For more information on Oracle Geometries, see Oracle Geometries.

v_pannam

VARCHAR2

Panel name.

v_pannum

NUMBER

Panel number.

v_panpos

VARCHAR2

XY offset from the lower left corner in mm. The format is X,Y where both values are positive.

v_pscale

NUMBER

Scale denominator.

v_pusage

VARCHAR2

Deprecated - this parameter is not used.

v_datumname

VARCHAR2

Horizontal datum name. This is the 4 character code from the datum.dat file.

v_helmert

HELMERT_TYPE

Ellipsoid and datum transformation information. The HELMERT_TYPE type contains the semi major axis, semi minor axis, origin_x, origin_y, origin_z, rotation_x, rotation_y, rotation_z, and scaling factor from the datum.dat file. If the panel is using a Helmert transformation to relate it to WGS- 84 then these values will be used for the Helmert transformation. Even if a block shift is being used to relate the panel to WGS-84, the semi-major and semi-minor axes listed here should be set to the values in the datum.dat entry, because those values affect the panel's geographic (lat/long) calculations.

v_xyshift

SHIFTXY_TYPE

Shift specified in meters. An x/y shift can not be specified if a latitude/longitude shift is also specified.

v_latlongshift

SHIFTLATLONG_TYPE

Shift specified in decimal degrees. A latitude/longitude shift can not be specified if an x/y shift is also specified.

v_bdrtyp

VARCHAR2

Border type.

v_depdat

VARCHAR2

Depth datum.

v_depunt

VARCHAR2

Depth units.

v_hghtda

VARCHAR2

Height datum.

v_hghtun

VARCHAR2

Height units.

v_pantit

VARCHAR2

Panel title.

v_pantyp

NUMBER

Type of panel.

NULL = Undefined

1 = Index

2 = Base

3 = Inset

4 = Extension

5 = Graphic

v_parusd

VARCHAR2

Parameters used.

v_prjctn

VARCHAR2

Projection information. This is a composite string composed of the projection name, central meridian, latitude of y coordinate origin, scale factor, scaling latitude 1, scaling latitude 2, and skew azimuth separated by commas.

The following projection names are supported:

AZIMUTHAL EQUIDISTANT

CASSINI

GNOMONIC

LAMBERT CONFORMAL CONIC

MERCATOR

POLAR STEREOGRAPHIC

POLYCONIC

RECTIFIED SKEW ORTHOMORPHIC

STEREOGRAPHIC

TRANSVERSE MERCATOR

Different projections require a different subset of the values - the non-required values can be set to zeroes.

v_pronam

VARCHAR2

Project name.

v_shftns

NUMBER

Shift N/S.

v_shftew

NUMBER

Shift E/W.

v_srchdp

VARCHAR2

Source horizontal datum parameters.

v_srchdt

VARCHAR2

Source horizontal datum name.

v_symlib

VARCHAR2

Symbol library used.

v_annoid

VARCHAR2

Identifier for annotation files.

v_presid

VARCHAR2

Identifier for presentation formats.

v_sdgfc

VARCHAR2

Sounding feature code.

v_sdgsz

VARCHAR2

Sounding size in millimetres.

v_rotate

NUMBER

Rotation angle of the panel, in degrees. 0, 90 and 270 are valid values.

v_panord

NUMBER

Order the panel will be drawn in.

v_sndrnd

VARCHAR2

Valid name from the Soundingrounding. xml file.

v_frcdsp

VARCHAR2

Fractional display value ('Y', 'N').

v_grtint

INTEGER

Latitude graticule interval, expressed in minutes. This is needed for BSB production.

Output

Type

Description

INTEGER

ID of the new panel.

Example

DECLARE

    -- Chart Parameters and Attributes

    v_CHTNUM        VARCHAR2(800)       := '101';

    v_CHTYPE        NUMBER              := 0; -- 0 OR 1

    v_CTDATE        DATE                := TO_DATE('31/12/2008', 'DD/MM/YYYY');

    v_USRNAM        VARCHAR2(1000)      := NULL;

    v_CHTCOM        VARCHAR2(800)       := 'This is an API Created Chart.';

    v_CTITL1        VARCHAR2(800)       := 'API Created Chart';

    v_CTITL2        VARCHAR2(800)       := 'API Created Chart';

    v_EDDATE        DATE                := TO_DATE('31/12/2008', 'DD/MM/YYYY');

    v_EDNUMB        NUMBER              := 1;

    v_INTNUM        NUMBER              := 2;

    v_LTSTNM        VARCHAR2(800)       := '3';

    v_NREGN1        VARCHAR2(800)       := 'Region 01';

    v_NREGN2        VARCHAR2(800)       := 'Region 02';

    v_PARCON        VARCHAR2(800)       := 'New Zealand';

    v_PUBCON        VARCHAR2(800)       := 'Canada';

    v_SAREA1        VARCHAR2(800)       := 'Sea Name 01';

    v_SAREA2        VARCHAR2(800)       := 'Sea Name 02';

    v_PUBDAT        DATE                := TO_DATE('31/12/2008', 'DD/MM/YYYY');

    v_SEANUM        NUMBER              := 1;

    v_CHPRID        VARCHAR2(20)        := NULL;

    v_productgroup  VARCHAR2(800)       := NULL;

    -- Sheet Parameters and Attributes

    v_LAYOUT        NUMBER              := 1; -- 0, PORTRAIT 1, LANDSCAPE

    v_MARGNB        NUMBER              := 5.0;

    v_MARGNL        NUMBER              := 10.0;

    v_MARGNR        NUMBER              := 5.0;

    v_MARGNT        NUMBER              := 10.0;

    v_PHEIGH        NUMBER              := 841.0;

    v_PPSIZE        NUMBER              := 17; -- ISO A0

    v_PWIDTH        NUMBER              := 1189.0;

    v_TSHEET        NUMBER              := 0; -- 0 CHART INSETS, 1 HARBOUR PLANS

    v_SHEET1        VARCHAR2(800)       := 'API Created Sheet';

    v_SHEET2        VARCHAR2(800)       := 'API Created Sheet';

    v_CMMNTS        VARCHAR2(800)       := 'API Created Sheet';

    -- Panel Parameters and Attributes

    v_CAHDAT        NUMBER              := 3;

    v_PANNAM        VARCHAR2(800)       := 'API Created Panel';

    v_PANNUM        NUMBER              := 15;

    v_PANPOS        VARCHAR2(10)        :='10,10';

    v_PSCALE        NUMBER              := 345000;

    v_BDRTYP        VARCHAR2(20)        := NULL;

    v_DEPDAT        VARCHAR2(20)        := NULL;

    v_DEPUNT        VARCHAR2(20)        := NULL;

    v_HGHTDA        VARCHAR2(20)        := NULL;

    v_HGHTUN        VARCHAR2(20)        := NULL;

    v_PANTIT        VARCHAR2(20)        := NULL;

    v_PANTYP        NUMBER              := 3; -- Inset

    v_PARUSD        VARCHAR2(20)        := NULL;

    v_PRJCTN        VARCHAR2(800)       := 'MERCATOR,0,0,0,53.75,0,0';

    v_PRONAM        VARCHAR2(20)        := NULL;

    v_SHFTNS        NUMBER              := NULL;

    v_SHFTWW        NUMBER              := NULL;

    v_SRCHDP        VARCHAR2(800)       := NULL;

    v_SRCHDT        VARCHAR2(800)       := NULL;

    v_SYMLIB        VARCHAR2(800)       := NULL;

    v_ANNOID        VARCHAR2(20)        := NULL;

    v_PRESID        VARCHAR2(20)        := NULL;

    v_SDGFC         VARCHAR2(20)        := NULL;

    v_SDGSZ         NUMBER              := NULL;

    v_DATUMNAME     VARCHAR2(16)        := 'WG84';

    v_PROFILE_ID    NUMBER              := 7; -- Paper Chart Profile.

    v_HELMERT       HELMERT_TYPE        := HELMERT_TYPE(6378137, 6356752.314, 0, 0, 0, 0, 0, 0, 1);

    -- Note: Only one of these parameters (shiftLatLong and ShiftXY) can be set,

    --       the other MUST be NULL.

    v_SHIFTLATLONG  SHIFTLATLONG_TYPE   := SHIFTLATLONG_TYPE(6.7, 2.5);

    v_SHIFTXY       SHIFTXY_TYPE        := NULL;

    v_ROTATE        NUMBER              := 0; -- 0, 90 and 270 are valid rotations

    v_PANORD        NUMBER              := 1;

    v_SNDRND        VARCHAR2(100 CHAR)  := 'Default';

    v_FRCDSP        VARCHAR2(1 CHAR)    := 'N';

    v_GRTINT        NUMBER              := 10;

    v_GEOM_WGS94     SDO_GEOMETRY  :=

                      SDO_GEOMETRY(2003, NULL, NULL,

                        SDO_ELEM_INFO_ARRAY(1, 1003, 1),

                        SDO_ORDINATE_ARRAY(-41.7143242, 40.4763209,

                          -39.68763209, 40.4643090, -39.6876436, 41.57026710,

                          -41.7143242, 41.57026710, -41.7143242, 40.47632090));

    v_chartver_id   NUMBER;

    v_sheetver_id   NUMBER;

    v_panelver_id   NUMBER;

BEGIN

    -- get the current user.

    SELECT USERNAME INTO v_USRNAM

    FROM hpd_user

    WHERE UPPER(USERNAME) = UPPER(USER);

    -- Create a new Chart.

    v_chartver_id := P_PPRAPI.ADDCHART(

    v_CHTNUM, v_CHTYPE, v_CTDATE, v_USRNAM, v_CHTCOM, v_CTITL1, v_CTITL2,

    v_EDDATE, v_EDNUMB, v_INTNUM, v_LTSTNM, v_NREGN1, v_NREGN2, v_PARCON,

    v_PUBCON, v_PUBDAT, v_SAREA1, v_SAREA2, v_SEANUM, v_CHPRID, v_productgroup);

    -- Display the new Chart Version ID.

    DBMS_OUTPUT.PUT_LINE('--*-- Created Paper Chart Version ID: '||v_CHARTVER_ID);

    -- Create a new Sheet, add sheet to the chart.

    v_sheetver_id := P_PPRAPI.ADDSHEET(

    v_CHARTVER_ID, v_LAYOUT, v_MARGNB, v_MARGNL, v_MARGNR, v_MARGNT,

    v_PHEIGH, v_PPSIZE, v_PWIDTH, v_TSHEET, v_SHEET1, v_SHEET2, v_CMMNTS);

    -- Display the new Sheet Version ID.

    DBMS_OUTPUT.PUT_LINE('--*-- Created Sheet Version ID: '||v_SHEETVER_ID);

    -- Create a new Panel, add panel to the sheet.

    v_panelver_id := P_PPRAPI.ADDPANEL(

    v_SHEETVER_ID, v_PROFILE_ID, v_GEOM_WGS84, v_PANNAM, v_PANNUM, v_PANPOS,

    v_PSCALE, NULL, v_DATUMNAME, v_HELMERT, v_SHIFTXY, v_SHIFTLATLONG,

    v_BDRTYP, v_DEPDAT, v_DEPUNT, v_HGHTDA, v_HGHTUN, v_PANTIT, v_PANTYP,

    v_PARUSD, v_PRJCTN, v_PRONAM, v_SHFTNS, v_SHFTWW, v_SRCHDP, v_SRCHDT,

    v_SYMLIB, v_ANNOID, v_PRESID, v_sdgfc, v_sdgsz, v_ROTATE, v_PANORD,

    v_SNDRND, v_FRCDSP, v_GRTINT);

    -- Display the new Panel Version ID.

    DBMS_OUTPUT.PUT_LINE('--*-- Created Panel Version ID: '|| v_PANELVER_ID);

END;

/

Exceptions

Sheet version id is required.

Panel attribute 'PSCALE' must be a positive integer.

Panel attribute 'PANPOS' format is invalid. Format: (A,B) where A and B are numeric.

Projection format is invalid. Format sample: 'PROJECTION NAME,X.XXX,X.XXX,X.XXX,X.XXX,X.XXX,X.XXX' where X is numeric values only.

The Projection Name '<name>' is invalid or does not exist in the current list.

Empty or Null value found in Projection Parameter <X>.

Projection Parameter <X> contains multiple decimal points - only 1 is permitted.

Projection Parameter <X> is invalid or not numeric.

Profile '<profile>' does not belong to the '<editor_name>' editor.

Panel attribute 'PROFILE' must be a number. It is the profile id.

Panel attribute 'GRTINT' must be an integer in the range of 1 through 10800.

Value '<value>' for panel attribute 'PANORD' must be an integer in the range of 1 through 9999.

Value '<value>' for panel attribute 'PANORD' is already in use by another panel of the chart.

Value '<value>' for panel attribute '<acronym>' is already in use by another panel of the chart.

Panel attribute '<acronym>' cannot be UNDEFINED.

Panel attributes PANPOS, PSCALE, PRJCTN and PROFILE cannot be UNDEFINED.

Panel attributes PSCALE, PRJCTN, DATUM, and PROFILE cannot be changed when the panel contains data.

Panel attributes 'sndrnd', 'frcdsp', and 'PROFILE' can not be set when there are multiple panel versions.

Value '<value>' is not valid for attribute '<acronym>'. Date format is YYYYMMDD, e.g. 20081231.

Value '<value>' is not valid for attribute '<acronym>'. It should be an integer.

Value '<value>' is not valid for attribute '<acronym>'. It should be a number.

Invalid rotation value given. Rotation can only be 0, 90, or 270.