This document is archived and information here might be outdated. Recommended version. |
Creates a predefined vertical coordinate system from an enumeration or ID code.
[Visual Basic .NET] Public Function CreateVerticalCoordinateSystem ( _ ByVal vcsID As Integer _ ) As IVerticalCoordinateSystem
[C#] public IVerticalCoordinateSystem CreateVerticalCoordinateSystem ( int vcsID );
[C++]
HRESULT CreateVerticalCoordinateSystem(
long vcsID
);
[C++] Parameters vcsID
vcsID is a parameter of type long
Use an element from the esriSRVerticalCSType enumeration as the VerticalCSType to create a particular predefined vertical coordinate system.
private void CreateVerticalReferenceSystem()
{
// use activator class with SpatialReferenceEnvironment singleton
Type factoryType = Type.GetTypeFromProgID("esriGeometry.SpatialReferenceEnvironment");
System.Object obj = Activator.CreateInstance(factoryType);
ISpatialReferenceFactory3 spatialReferenceFactory = obj as ISpatialReferenceFactory3;
// Dimension a vertical datum and vertical coordinate system
// Use the enumerations to create instances of the predefined objects
IVerticalDatum verticalDatum = spatialReferenceFactory.CreateVerticalDatum((int)esriSRVerticalDatumType.esriSRVertDatum_Alicante);
IVerticalCoordinateSystem verticalCoordinateSystem = spatialReferenceFactory.CreateVerticalCoordinateSystem((int)esriSRVerticalCSType.esriSRVertCS_Alicante);
}
Dim pSRF As ISpatialReferenceFactory3
pSRF = New SpatialReferenceEnvironment
Dim pVCS As IVerticalCoordinateSystem
Dim pGCS As IGeographicCoordinateSystem2
Dim pSpatialReference3 As ISpatialReference3
pGCS = pSRF.CreateGeographicCoordinateSystem(esriSRGeoCSType.esriSRGeoCS_NAD1927)
pSpatialReference3 = pGCS
pVCS = pSRF.CreateVerticalCoordinateSystem(esriSRVerticalCSType.esriSRVertCS_NAVD1988)
pSpatialReference3.VerticalCoordinateSystem = pVCS
Dim pVCS2 As IVerticalCoordinateSystem
pVCS2 = pSpatialReference3.VerticalCoordinateSystem