This document is archived and information here might be outdated.  Recommended version.


IVerticalCoordinateSystemEdit.Define Method (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Geometry > ESRI.ArcGIS.Geometry > Interfaces > IV > IVerticalCoordinateSystemEdit Interface > IVerticalCoordinateSystemEdit.Define Method
ArcGIS Developer Help

IVerticalCoordinateSystemEdit.Define Method

Defines the properties of a vertical coordinate system.

[Visual Basic .NET]
Public Sub Define ( _
    [ByRef Name As Object], _
    [ByRef Alias As Object], _
    [ByRef Abbreviation As Object], _
    [ByRef Remarks As Object], _
    [ByRef useage As Object], _
    [ByRef hvDatum As Object], _
    [ByRef projectedUnit As Object], _
    [ByRef VerticalShift As Object], _
    [ByRef PositiveDirection As Object] _
)
[C#]
public void Define (
    ref object Name,
    ref object Alias,
    ref object Abbreviation,
    ref object Remarks,
    ref object useage,
    ref object hvDatum,
    ref object projectedUnit,
    ref object VerticalShift,
    ref object PositiveDirection
);
[C++]
HRESULT Define(
  Variant* Name,
  Variant* Alias,
  Variant* Abbreviation,
  Variant* Remarks,
  Variant* useage,
  Variant* hvDatum,
  Variant* projectedUnit,
  Variant* VerticalShift,
  Variant* PositiveDirection
);
[C++]
Parameters
Name [optional]

Name is a parameter of type VARIANT* Alias [optional]
Alias is a parameter of type VARIANT* Abbreviation [optional]
Abbreviation is a parameter of type VARIANT* Remarks [optional]
Remarks is a parameter of type VARIANT* useage [optional]
useage is a parameter of type VARIANT* hvDatum [optional]
hvDatum is a parameter of type VARIANT* projectedUnit [optional]
projectedUnit is a parameter of type VARIANT* VerticalShift [optional]
VerticalShift is a parameter of type VARIANT* PositiveDirection [optional]
PositiveDirection is a parameter of type VARIANT*

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Description

The Define method allows you to create a custom vertical coordinate system (VCS). You can use ISpatialReferenceFactory3 to create the predefined objects you need to define a VCS or use the various Edit interfaces to create custom objects.

A vertical coordinate system has two types. It can either be gravity-related, which requires a VerticalDatum; or ellipsoid/spheroid-based which requires a horizontal Datum. A horizontal Datum is the same as one used for a geographic coordinate system. You will also need a (linear) projectedUnit object. A VCS has two parameters. The positiveDirection value defines whether the vertical coordinate system has positive values 'up', heights, or 'down', depths. Use -1 for positive depths. The verticalShift parameter is a way to identify this VCS as offset from some other known surface. For example, you might know that a dataset's depths are referenced to mean lower low water (a tidal level). You might also know that for this dataset, mean lower low water is 1.23 meters below local mean sea level. The VCS could be defined for mean sea level but with a verticalShift of -1.23.

[C#]

    private IVerticalCoordinateSystem CreateEllipsedBasedVerticalCoordinateSystem()
    {
        //Creates an ellipsoid-based vertical coordinate system
        // use activator class with SpatialReferenceEnvironment singleton
        Type factoryType = Type.GetTypeFromProgID("esriGeometry.SpatialReferenceEnvironment");
        System.Object obj = Activator.CreateInstance(factoryType);
        ISpatialReferenceFactory3 spatialReferenceFactory = obj as ISpatialReferenceFactory3;

        IDatum datum = spatialReferenceFactory.CreateDatum((int)esriSRDatumType.esriSRDatum_WGS1984);
        //Because a VCS can be based upon Datum or VerticalDatum, IHVDatum is used
        //when defining a vertical coordinate system.
        IHVDatum hvDatum = datum as IHVDatum;
        ILinearUnit linearUnit = spatialReferenceFactory.CreateUnit((int)esriSRUnitType.esriSRUnit_Foot) as ILinearUnit;

        //Direction is again positive down, while the vertical shift is 0.4839
        IVerticalCoordinateSystemEdit verticalCoordinateSystemEdit = new VerticalCoordinateSystemClass();
        object name = "WGS84 vcs";
        object alias = "WGS84 ellipsoid";
        object abbreviation = "w84 3d";
        object remarks = "WGS84 ell-based vcs";
        object usage = "everywhere!";
        object hvDatumObject = hvDatum as object;
        object unitObject = linearUnit as object;
        object verticalShift = 0.4839 as object;
        object positiveDirection = -1 as object;
        verticalCoordinateSystemEdit.Define(ref name,
                                            ref alias,
                                            ref abbreviation,
                                            ref remarks,
                                            ref usage,
                                            ref hvDatumObject,
                                            ref unitObject,
                                            ref verticalShift,
                                            ref positiveDirection);
        IVerticalCoordinateSystem verticalCoordinateSystem = verticalCoordinateSystemEdit as IVerticalCoordinateSystem;
        return verticalCoordinateSystem;
    }

See Also

IVerticalCoordinateSystemEdit Interface