Length of the Polyline is returned as NaN and isEmpty is True

429
0
01-25-2013 07:42 PM
shreyesshiv
New Contributor III
I have written the following piece of code.

here topParentobject is IRow.
I checked values inside the topParentobject it is present.
When i cast the irow to ifeature and further into igeometry all the values are lost
following is the piece of code,

IFeature lastFeature = (IFeature)topParentobject; // in this place the isEmpty is false
IGeometry lastFeatureGeometry = lastFeature.ShapeCopy as IGeometry; // in this place the isEmpty is false
Ipolyline lastLine = lastFeatureGeometry as IPolyline; // in this place the isEmpty is true and Length is NaN. While in reality the length of the Polyline is 250m.

The vertices of the line features are not duplicate but still the problem is arising.

1278799.757 2755664.841
1278726.952 2755624.480
1278643.215 2755578.058
1278639.237 2755578.200
1278638.736 2755578.218

the difference is only in the decimal places but they are different.

Please tell me how to resolve this problem.


thank you
0 Kudos
0 Replies