This document is archived and information here might be outdated. Recommended version. |
The VCS associated with this spatial reference.
[Visual Basic .NET] Public Property VerticalCoordinateSystem As IVerticalCoordinateSystem
[C#] public IVerticalCoordinateSystem VerticalCoordinateSystem {get; set;}
[C++]
HRESULT get_VerticalCoordinateSystem(
IVerticalCoordinateSystem** vcs
);
[C++]
HRESULT putref_VerticalCoordinateSystem(
IVerticalCoordinateSystem* vcs
);
[C++]
Parameters vcs [out, retval]
vcs is a parameter of type IVerticalCoordinateSystem** vcs
vcs is a parameter of type IVerticalCoordinateSystem*
ISpatialReferenceFactory3 srf3 = new SpatialReferenceEnvironmentClass();
IVerticalCoordinateSystem vcs1, vcs2;
vcs1=srf3.CreateVerticalCoordinateSystem(5702);//NGVD_1929
vcs2=srf3.CreateVerticalCoordinateSystem(5703);//NAVD_1988
ISpatialReference sr1, sr2;
sr1=srf3.CreateSpatialReference(4269);//GCS_North_American_1983
((ISpatialReference3)sr1).VerticalCoordinateSystem=vcs1;
sr2=srf3.CreateSpatialReference(5070);//NAD_1983_Contiguous_USA_Albers
((ISpatialReference3)sr2).VerticalCoordinateSystem=vcs2;
IProjectedCoordinateSystem pcs2=(IProjectedCoordinateSystem)sr2;
IGeographicCoordinateSystem gcs1=(IGeographicCoordinateSystem)sr1;
IGeographicCoordinateSystem gcs2=pcs2.GeographicCoordinateSystem;
IHVCompositeDatumTransformationEditor edit = new HVCompositeDatumTransformationEditorClass();
IHVDatumTransformation hvdt;
edit.SetSpatialReferences(gcs1, gcs2);
hvdt=edit.CreateHVDatumTransformation(110011);//PE_VT_NGVD29_TO_NAVD88_NAD83_ECW
edit.Add(hvdt, esriTransformDirection.esriTransformForward);
IHVCompositeDatumTransformation hvcdt=edit.CreateNew();
ITransformation transform=(ITransformation)hvcdt;
IPoint pnt = new PointClass();
pnt.SpatialReference=sr1;
pnt.PutCoords(4, 3);
((IZAware)pnt).ZAware = true;
pnt.Z=5;
((IGeometry5)pnt).ProjectEx5(sr2, esriTransformDirection.esriTransformForward, transform, false, 0, 0, ((int)esriProjectionHint.esriProjectionHintDefault) & ((int)esriProjectionHint.esriProjectionHintFindGeoTransformation));
double x, y, z;
pnt.QueryCoords(out x, out y);//10421841.071915826, 3982079.5947264349
z=pnt.Z;//1.5240030480060962