Exemple #1
0
        static void Main(string[] args)
        {
            //Initialize license
            m_License.InitializeApplication(new esriLicenseProductCode[] { esriLicenseProductCode.esriLicenseProductCodeAdvanced }, new esriLicenseExtensionCode[] { });
            //Handling
            DateTime starttime = DateTime.Now;
            Console.WriteLine("============Begining processing: " + starttime.ToString() + "============");
            string dirpath = @"f:\data\";
            //string filename = "origin";
            string filename = "test";

            //****************************************************************************

            PolygonsPartitionAggregation ppa=new PolygonsPartitionAggregation(dirpath,filename,dirpath,"FinalScore");
            ppa.Exceute();
            //****************************************************************************

            DateTime endtime = DateTime.Now;
            TimeSpan ts=endtime.Subtract(starttime);
            Console.WriteLine("The handling time is " + ts.TotalMinutes+" minutes");
            Console.WriteLine("============Finished: " + endtime.ToString()+"============");
            Console.WriteLine("Please hit any key to exit!");
            Console.ReadLine();
            //Shutdown license
            m_License.ShutdownApplication();
        }
        private void okbtn_Click(object sender, EventArgs e)
        {
            if (_hookHelper.FocusMap.LayerCount == 0)
                return;
            IFeatureLayer fealyr = GetFeatureLayer((string)lyrcomboBox.SelectedItem);
            string resultPath = outputtextBox.Text;

            //开始处理
            using(PolygonsPartitionAggregation ppa = new PolygonsPartitionAggregation(fealyr,resultPath,"FinalScore"))
            {
                ppa.PhaseExcutedEvent += new AggregationHandler(ppa_PhaseExcutedEvent);
                ppa.PhaseResultEvent += new ResultHandler(ppa_PhaseResultEvent);
                ppa.Exceute();

            }
        }