Arcengine development, when a layer contains z-values, the new feature does not have Z-values and "The Geometry has no Z-value" error. It is obvious that the new geometry does not have Z-values.
At this time according to the conventional idea, take out each point of Geometry, set z=0 respectively, the theory is feasible, but the actual commissioning process still reported "the Geometry has no z-value".
The following solutions are available:
Igeometry geometry = feature. Shapecopy;izaware Zaware = (izaware) Geometry;zaware.zaware = true;
With this conversion, the geometry has the z attribute. Zaware.zaware is to control whether geometry has Z-values, and of course you can use Izaware to remove Geometry Z-values.
The story should end here, but debugging time and error, then the mistake is "the Geometry has null Z-value", meaning is also very obvious, Z is empty, does not pass ....
Then use the general scheme, take out each point of geometry, set z=0 ... the result is the same as the error.
The solution is as follows:
IZ IZ = (IZ) Geometry;iz. Setconstantz (0);
Run, pass ....
AE offers a lot of conversion interfaces, much simpler and more effective than our own writing ... Of course, because there are many structures in AE that are not publicly available, some of our regular solutions are sometimes less useful. I hope I can help the AE coder! with this problem.
Arcengine Development, Featureclass new feature when "The Geometry has no z-value" or "the Geometry has null Z-value" solution