Beispiel #1
0
        public void GetOlines(string inDataPath, string _outDSpath, string OutShpPath, double ImprotLevel = 80)
        {
            Gdal.AllRegister();

            qthread = new QThread(OutShpPath);
            Dataset _inDataset  = Gdal.Open(inDataPath, Access.GA_ReadOnly);
            Dataset _outDataset = Gdal.Open(_outDSpath, Access.GA_ReadOnly);

            AutoResetEvent autoRE = new AutoResetEvent(false);
            int            iCount = 0, Maxcnt = GetCutNumberOfImg(inDataPath);

            for (int i = 0; i < Maxcnt; i++)
            {
                CutData data = new CutData(inDataPath, _outDSpath, OutShpPath, i, ImprotLevel);
                Thread  th   = new Thread((tt) =>
                {
                    TKData(tt);
                    iCount++;
                    if (iCount == Maxcnt)
                    {
                        autoRE.Set();
                    }
                });
                th.Name = "thNM_" + i.ToString();
                th.Start(data);
            }
            autoRE.WaitOne();
            qthread.Close();
        }
Beispiel #2
0
        public void MyGetOutlines(string inDataPath, string _outDSpath, string OutShpPath, double ImprotLevel = 80)
        {
            qthread = new QThread(OutShpPath);
            asyRE   = new AutoResetEvent(false);
            Thread th = new Thread(() => {
                GetOlines00(inDataPath, _outDSpath, OutShpPath, ImprotLevel);
            });

            th.Start();
            asyRE.WaitOne();
            qthread.Close();
        }