private void importAddressingDistrictsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            dlgOpenMdbFile.Title    = "Please select an addressing database";
            dlgOpenMdbFile.FileName = "*.mdb";
            dlgOpenMdbFile.Filter   = "Addressing Database|*.mdb";

            if (dlgOpenMdbFile.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    var mDistrictsFeatureSet = ExtFunctions.GetDistrictsFeatureSetFromAdmAdrMdb(ref this.pgBar, dlgOpenMdbFile.FileName, 0);
                    if (mDistrictsFeatureSet == null)
                    {
                        return;
                    }
                    var mDistrictsLayer = ExtFunctions.GetFeatureLayer(theMap.Layers, mDistrictsFeatureSet, "Districts", MapSymbols.PolygonSymbol(Color.Transparent, Color.Red), KnownCoordinateSystems.Projected.UtmWgs1984.WGS1984UTMZone40N);

                    mDistrictsLayer.DataSet.ExportToShapeUsingOgr(DistrictImport.GetShapefileName());

                    mDistrictsLayer.Reproject(theMap.Projection);
                    theMap.Refresh();


                    // Set properties
                    Properties.Settings.Default.DistrictFilePresent    = true;
                    Properties.Settings.Default.DistrictImportFileDate = DateTime.Now;

                    Log("Operation completed, saved imported districts to: " + DistrictImport.GetShapefileName());
                }
                catch (Exception ex)
                {
                    Log("Operation aborted: " + ex.Message);
                    Log("Look for issues with duplicate district abbreviations and make sure that you have selected an 'adm-adr' ESRI Personal Geodatabase file that contains districts...");
                }
            }
        }
        private void btnTest_Click(object sender, EventArgs e)
        {
            Gdal.SetConfigOption("SHAPE_ENCODING", "UTF-8");
            using (DataSource ds = Ogr.Open(DistrictImport.GetShapefileName(), 0))
            {
                using (OSGeo.OGR.Layer l = ds.GetLayerByIndex(0))
                {
                    OSGeo.OGR.Feature f;

                    while (null != (f = l.GetNextFeature()))
                    {
                        this.Log(f.GetFieldAsString("NAMEARABIC"));
                    }
                }
            }
            //var dlgSelectPGeo = new OpenFileDialog
            //{
            //    Title = "Please select a Personal Geodatabase",
            //    Filter = "Microsoft Access database|*.accdb",
            //    InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
            //};

            //var dlgSelectFileGDB = new FolderBrowserDialog
            //{
            //    RootFolder = Environment.SpecialFolder.Desktop,
            //    Description = "Please select an ESRI FileGeodatabasee (a folder with .gdb ending)"
            //};

            //if (dlgSelectFileGDB.ShowDialog() != System.Windows.Forms.DialogResult.OK)
            //{
            //    return;
            //};

            //if (!dlgSelectFileGDB.SelectedPath.EndsWith(".gdb"))
            //{
            //    Log("Selected folder does not have the correct *.gdb extension");
            //    return;
            //}

            //using (OSGeo.OGR.DataSource districtDataSource = OSGeo.OGR.Ogr.Open(dlgSelectFileGDB.SelectedPath, 0))
            //{
            //    if (districtDataSource == null)
            //    {
            //        Log("The data source does not exist");
            //    }

            //    using (OSGeo.OGR.Layer lyr = districtDataSource.GetLayerByName("Street_name_signs"))
            //    {

            //        if (lyr == null)
            //        {
            //            Log("The layer could not be opened");
            //            return;
            //        }

            //        OSGeo.OGR.Feature f;
            //        var districtLayer = new List<OgrFeature>();
            //        var of = new OgrStreetNameSign();
            //        while (null != (f = lyr.GetNextFeature()))
            //        {
            //            of.PopulateFromOgrFeature(f);
            //            districtLayer.Add(of);
            //            Log(of.QR_CODE);
            //        }
            //        Log(districtLayer.Count);
            //    }
            //}

            //var s = new SignTestTableANS();
            //Log(s.CreateStatement());
        }