Arcengine Development, Featureclass new feature when "The Geometry has no z-value" or "the Geometry has null Z-value" solution

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.