[GIS] How to programmatically project the Z value of a z-aware feature point, using ArcObjects in .NET/C#

arcobjectsccoordinate systemelevationnet

I discovered the following code leaves the Z coordinate of featurePt untouched:

// if not WGS84 project it
if (!SpatialRefsEqual(featureSpatialRef, srWgs84))
{
    // featurePt here is a Z-Aware instance of IPoint
    // use the Geometry Interface to do the actual project
    featurePt.SpatialReference = featureSpatialRef;
    featurePt.Project(srWgs84);
}

I see the IVerticalCoordinateSystem interface but it unclear to me how to use it to do a projection. For example, simply plugging it in via:

featurePt.Project(myInstanceOfIVerticalCoordinateSystem)

still leaves Z untouched.

It also seems like I could just write a routine to convert the Z-coordinate in the linear units of the layer to my desired linear units (meters in this case).

Is there a best practice for projecting the Z-coordinate?

EDIT

According to mkennedy at ESRI, ArcGIS does not provide a true vertical transformation (thank you for answering!). If anyone knows of any outside library to vertically transform among vertical datums please let me know.

Best Answer

Currently, ArcGIS 10 does not do any vertical coordinate system conversions. You can define a vertical coordinate system on a dataset, but the software isn't using the information except when defining the spatial reference (min/max z, z resolution/tolerance values). ArcScene/ArcGlobe may be checking the z units. We do plan to add vcs conversions in a future release. It has not been scheduled yet, so I cannot name a particular release or time frame.

std. disclaimer: I work for Esri.