private void CovertPolygonLayerToZones(PolygonZone zonDef, FeatureLayer polygLayer) { int fcount = wpfMap1.TrackOverlay.TrackShapeLayer.InternalFeatures.Count; polygLayer.FeatureSource.Open(); IEnumerable allPolygons = polygLayer.FeatureSource .GetAllFeatures(ReturningColumnsType.AllColumns) .OfType (); MultipolygonShape mpolyg = new MultipolygonShape(allPolygons); Collection polyg= mpolyg.Polygons; for (int i=0;i vtxs=polyg[0].OuterRing.Vertices; // this caused "Index was out of range" runtime problem } catch (Exception e) { MessageBox.Show(ex.ToString(),"Exception"); } } }