Detect if the line segment is of type "ICurve"

1371
8
01-13-2014 04:45 AM
HaythamAbdel-Rahman
New Contributor
I'm using ArcGIS 10.1, and I have polyline feature Class, some of it's features have curves in it, how can I detect these features?
0 Kudos
8 Replies
NeilClemmons
Regular Contributor III
You'll have to loop through the segment collection of each feature's geometry.  Use TypeOf (VB.NET) or Is (C#) to see if a segment implements one of the interfaces associated with curves (i.e. ICircularArc, IEllipticArc, etc).  Unless they've added some new types recently, pretty much anything that isn't a Line is a curve of some type.  So, you could just test the segment to see if it isn't ILine.
0 Kudos
LeoDonahue
Occasional Contributor III
I'm not sure it's that easy to just test whether it implements ICurve.  You can see that even ILine implements ICurve.

As Neil suggested, you might want to test for the types of Curves you think your polyline featureclass contains.  You will have test each feature in your featureclass.

[ATTACH=CONFIG]30454[/ATTACH]
0 Kudos
LeoDonahue
Occasional Contributor III
What if you got the first and last points in the segment and created a new line segment then tested whether any of the middle points intersect that line?

[edit]
That won't work either, depending on how the feature was digitzed.  I'm no help. 🙂
0 Kudos
by Anonymous User
Not applicable
The easier way to check is to cast each feature into a segment collection then use the ISegmentCollection.HasNonLinearSegments Method.
0 Kudos
LeoDonahue
Occasional Contributor III
Sean,

Would the ITopologicalOperater isSimple() give you the same result?
0 Kudos
by Anonymous User
Not applicable
Would the ITopologicalOperater isSimple() give you the same result?

Not really in this case. isSimple will just tell you if a geometry is topological correct regardless of the geometry type, whereas the original question was more about 'does my feature have any curves in it.
0 Kudos
HaythamAbdel-Rahman
New Contributor
Thanks a lot guys for the two solutions, i'll try both and tell you the results. Thanks again.
0 Kudos
WeifengHe
Esri Contributor
If you want to know which type of curve in your geometry, get the GeometryType property of ISegment.
0 Kudos