# How can I programmatically project the Z value of a z-aware feature point, using ArcObjects in .NET/C#?

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. If anyone knows of any outside library to vertically transform among vertical datums please let me know.

• Could you explain what you mean by "projecting" the z-coordinate, Josh? Normally, heights are not affected by changes of (planar) coordinate systems and therefore do not need to be changed at all when reprojecting the map coordinates. Apr 29, 2011 at 18:50
• Do both the input and the output spatialreference have a defined vcs property? Apr 29, 2011 at 19:17
• @whuber, I basically mean "convert" the z-coordinate, specifically the linear units, feet to meters, etc. Part of my confusion lies in the distinction between the GIS definition of a coordinate system and the 3D graphics definition of a coordinate space (where one transforms X,Y and Z). So maybe my question doesn't make sense. I should just look at the source linear units and convert Z to whatever units I require (again, meters...).
– Josh
Apr 29, 2011 at 22:42
• after speaking again with the team: simply converting Z between linear units is naive. I truly need a vertical coordinate transformation. For example, EGM96 to/from EGM2008, both of which could be expressed in meters.
– Josh
Apr 30, 2011 at 0:04