huangs3

Why the geometry can change when it is assigned to IFeature.Shape?

Discussion created by huangs3 on Sep 16, 2013
Latest reply on Sep 16, 2013 by rfairhur24
Hi Everybody:

    I wrote a program to generate geometries for linear features. However, I found that the geometries are slightly changed after assigned to IFeature.Shape. Following is my code:

// newShape is IPolyline 
m_editor.StartOperation();
m_linear_feature.Shape = newShape;
m_linear_feature.Store();
m_editor.StopOperation("Reshape linear feature");


    I checked the coordinates of (newShape as IPolyline).ToPoint before and after running the line "m_linear_feature.Shape = newShape".

Before: X = -92.836516205759764, Y = 40.870457300856849, Z = 900.537152489813
After:   X = -92.836516205999942, Y = 40.870457301000044, Z = 900.53715249001107

   What is the reason for this change? Is there any way to avoid it?
   Thank you!

Outcomes