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;
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:
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?
According to mkennedy at ESRI, ArcGIS does not provide a true vertical transformation. If anyone knows of any outside library to vertically transform among vertical datums please let me know.