Hi guys,
I keep getting cast exceptions when I try to cast a lineshape feature to a multilineshape. I've tried several ways including:
1. MultilineShape multilineShape = (MultilineShape)feature.GetShape();
2. MultilineShape multilineShape = new MultilineShape(feature.GetWellKnownBinary());
3. MultilineShape multilineShape = (MultilineShape)MultilineShape.CreateShapeFromWellKnownData(feature.GetWellKnownBinary());
4. Tried with the well known text string as well.
But the only thing that works is:
List<LineShape> lines = new List<LineShape>();
lines.Add((LineShape)feature.GetShape());
MultilineShape multilineShape = new MultilineShape(lines);
Why can't I cast it directly? I got example 1 above from a working sample in the Desktop Edition (Displaying One Way Streets).
Thanks,
Nirish